MikeC14081972
Programmer
I have a form with an embedded Microsoft Web Browser Active X Control (calledWebBrowser)
The browser will load the required site but I'm having problems entering a value to a control on the webpage.
Code Below:
The code fails on the line
with error 91: Object Variable or With Block Variable not set.
By stepping through the code you can force the code to work but not when running normally.
Does anyone know the answer ?
If you make something idiot proof - They'll Only make a better idiot!!!
The browser will load the required site but I'm having problems entering a value to a control on the webpage.
Code Below:
Code:
Dim strURL As String
Dim IE As Object
strURL = "Website Address"
Set IE = Me.WebBrowser.Object
IE.Navigate strURL
With IE
.Document.all("SearchValue").select
.Document.all("SearchValue").Value = "Required Value"
.Document.all("Submit").select
.Document.all("Submit").Click
End With
The code fails on the line
Code:
.document.all("SearchValue").select
with error 91: Object Variable or With Block Variable not set.
By stepping through the code you can force the code to work but not when running normally.
Does anyone know the answer ?
If you make something idiot proof - They'll Only make a better idiot!!!