PDA

View Full Version : Access VBA sign into web URL



talliaman64
09-12-2018, 12:07 PM
Trying to get some VBA code I found here to work and am not having any luck. I get "Run Time Error 91 - Object variable or with block variable not set"
Here is the code.....

Private Sub Command0_Click()
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.Navigate "https://etrax.datamatx.net/signon.asp"
Do Until .ReadyState = 4
DoEvents
Loop
.Document.all.Item("loginUserName").Value = "username"
.Document.all.Item("loginUserPassword").Value = "password"
.Document.Forms(0).submit
End With

OBP
09-13-2018, 08:09 AM
The Variable that you are using for Internet Explorer "ie" has not been Dimensioned for Access VBA to allocate memory space to it.

Try
Dim ie as Object

PhilS
09-21-2018, 01:17 AM
Trying to get some VBA code I found here to work and am not having any luck. I get "Run Time Error 91 - Object variable or with block variable not set"
[...]
.Document.all.Item("loginUserName").Value = "username"
.Document.all.Item("loginUserPassword").Value = "password"

The web page does not contain any element named "loginUserName".