Ajinkya_2019
New Member
- Today, 08:58 AM#1
★ Ajinkya_1988
New MemberJoin DateMar 2019Posts2Post Thanks / Like Mentioned0 Post(s)Tagged0 Thread(s)
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.
For text box inspect element id and name is given.
For Search button inspect element is : type Submit
below is my code:
Code:
Sub login_page()
Dim ieApp As SHDocVw.InternetExplorer
Dim ieDoc As MSHTML.HTMLDocument
'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
▬▬▬▬▬▬▬▬▬ Mod edit : thread closed as duplicate !