Ajinkya_1988
New Member
- Joined
- Mar 29, 2019
- Messages
- 3
i am new to this forum. please solve my below query.
i want fill text box with my given value and click on search button. i cant provide the url as it will not work outside the office. i tried but getting object dose'nt support propery error and method.
text box inspect element is : <input type="text" size="40" name="agent" id="go" value="">
Search button inspect element is : <button type="submit">Submit</button>
below is my code:
i want fill text box with my given value and click on search button. i cant provide the url as it will not work outside the office. i tried but getting object dose'nt support propery error and method.
text box inspect element is : <input type="text" size="40" name="agent" id="go" value="">
Search button inspect element is : <button type="submit">Submit</button>
below is my code:
Code:
Sub login_page()
Dim ieApp As SHDocVw.InternetExplorer
Dim ieDoc As MSHTML.HTMLDocument
'Dim ieApp As InternetExplorer
'Dim ieDoc As Object
'Dim ieTable As Object
'Dim clip As DataObject
'create a new instance of ie
Set ieApp = New InternetExplorer
'you don’t need this, but it’s good for debugging
ieApp.Visible = True
'assume we’re not logged in and just go directly to the login page
ieApp.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
Set ieDoc = ieApp.document
'fill in the login form – View Source from your browser to get the control names
With ieDoc.forms(0)
.user.Value = "id"
.Password.Value = "password"
.submit
End With
ieApp.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop
'Do Until ieApp.readyState = READYSTATE_COMPLETE: DoEvents: Loop
ieApp.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop
ieApp.navigate "http:"
Do While ieApp.Busy: DoEvents: Loop
'Dim ie As HTMLInputElement
ieApp.document.parentWindow.execScript "****************='Go?action=agent'"
ieApp.document.getElementsById("go").Value = "123"
With ieApp.document
.getElementById("go").Value = "123"
End With
ieApp.document.parentWindow.getElementsbyid("go").Value = "123"
ieApp.document.parentWindow.getElementbyid("go").Value = "123"
ieApp.document.getElementById("go").Value = "123"
End Sub
Last edited by a moderator: