Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I need a help to improuve my work for navigating explorer via vba. Sure something has to be modified, but the true problem is the line associated to Runtime Error 91: object variable or with block variable not set., trying to click the button2.
Could anyone get me some hints?
I need a help to improuve my work for navigating explorer via vba. Sure something has to be modified, but the true problem is the line associated to Runtime Error 91: object variable or with block variable not set., trying to click the button2.
Code:
[B]InputClick2.Click[/B]
Code:
Sub Site()
Dim IE As New InternetExplorer
Dim IEDoc As HTMLDocument
Dim InputText As HTMLInputElement
Dim InputClick As HTMLInputElement
Dim InputClick2 As HTMLInputElement
IE.Navigate "http://xxxxxxxxxxxxxxxxxxx.ASPX"
IE.Visible = True
WaitIE IE
Set IEDoc = IE.document
Set InputText = IEDoc.all("input")
InputText.Value = "12345678"
Set InputClick = IEDoc.all("button")
InputClick.Click
WaitIE IE
Set InputClick2 = IEDoc.all("button2")
[B]InputClick2.Click[/B]
WaitIE IE
End Sub
Could anyone get me some hints?