I have been working on a project which requires me to populate a webform from Excel. I have managed to get this working 90% of the time. The other 10% I'm getting an automation error
Run-time error '-2147417848 (80010108)':
Automation Error
The object involked has disconnected from its clients.
This is the basis of the code that I am using to populate the webform
the automation error usually happens at one of the follow lines:
".Navigate "http://www.website.com"
".AddressBar = False"
"Do Until .ReadyState = 4: DoEvents: Loop"
I am looking for a way to handle this error.
Would putting On Error GOTO ErrorHandling before all this code work or do I need to specify the error that is occuring.
Also is there a way of applying this error check to an entire module.
Regards,
B
Run-time error '-2147417848 (80010108)':
Automation Error
The object involked has disconnected from its clients.
This is the basis of the code that I am using to populate the webform
Dim refcamp As String
refcamp = Worksheets("SheetName").Range("D8").Value
Set ie2 = CreateObject("InternetExplorer.Application")
With ie2
.Visible = True
.AddressBar = False
.Navigate "http://www.website.com
Do Until .ReadyState = 4: DoEvents: Loop
End With
Set Campaign = ie2.Document.all.Item("refcamp")
Campaign.Value = refcamp
ie2.Document.forms(0).submit
the automation error usually happens at one of the follow lines:
".Navigate "http://www.website.com"
".AddressBar = False"
"Do Until .ReadyState = 4: DoEvents: Loop"
I am looking for a way to handle this error.
Would putting On Error GOTO ErrorHandling before all this code work or do I need to specify the error that is occuring.
Also is there a way of applying this error check to an entire module.
Regards,
B