Hi,
I want to automatically log in to a website to get some information of it to load into my database. Below is an attempt to set the value of two textboxes on a login page. Does any body know why this would give the error: "91: objectvariable or with blockvariable not set"?
thanks
I want to automatically log in to a website to get some information of it to load into my database. Below is an attempt to set the value of two textboxes on a login page. Does any body know why this would give the error: "91: objectvariable or with blockvariable not set"?
thanks
Code:
Sub loginSite()
On Error GoTo errhandler
Dim ie As InternetExplorer
Dim docDOM As HTMLDocument
Dim input_user As HTMLInputElement
Dim input_pass As HTMLInputElement
Set ie = New InternetExplorer
ie.Navigate ("[URL="http://www/"]http://www[/URL]......")
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
Set docDOM = ie.Document
Set input_user = docDOM.getElementsByName("user").Item(Index:=0)
Set input_pass = docDOM.getElementsByName("password").Item(Index:=0)
input_user.Value = "JESSE"
input_pass.Value = "password"
ie.Visible = True
Exit Sub
errhandler:
Debug.Print "error" & Err.Number
Debug.Print Err.Description
End Sub