Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I don't understand why this error in getElementsByClassName.
I'm logging in a navigating a site via vba.
Error on the last row:
error 438 object doesn't support this property or method internet explorer
I don't understand why this error in getElementsByClassName.
I'm logging in a navigating a site via vba.
Code:
Sub navigate()
Dim myId As String, myCode As String
Dim IE As Object
myId = "user"
myCode = "password"
myURL = "https://example.com/wwww/"
Set IE = CreateObject("InternetExplorer.Application")
With IE
.navigate myURL
.Visible = True
Do While .Busy: DoEvents: Loop
Do While .readyState <> 4: DoEvents: Loop
End With
myStart = Timer
Do
DoEvents
If Timer > myStart + 1 Or Timer < myStart Then Exit Do
Loop
'Log in
IE.document.getElementsByTagName("input")(0).Value = myId
IE.document.getElementsByTagName("input")(1).Value = myCode
IE.document.getElementsByTagName("button")(0).Click
Do While IE.Busy: DoEvents: Loop 'Attesa not busy
Do While IE.readyState <> 4: DoEvents: Loop 'Attesa documento
IE.document.getElementsByClassName("close-tab")(0).Click
Error on the last row:
error 438 object doesn't support this property or method internet explorer
Last edited: