Hi,
As first I need to say I'm very new to VBA. I have took upon myself to build an automation for IE for my departament which when done will go to the website and put reference number in and search for certain client info.
I got stuck on very first hurdle and been researching internat for past 2 days to help me with problem but to no avail.
This is my code so far: (I have changed URL as its data sensitive):
The one in bold is where it crashes and gives me method 'document' of object 'iwebbrowser2' failed error. Help please!
As first I need to say I'm very new to VBA. I have took upon myself to build an automation for IE for my departament which when done will go to the website and put reference number in and search for certain client info.
I got stuck on very first hurdle and been researching internat for past 2 days to help me with problem but to no avail.
This is my code so far: (I have changed URL as its data sensitive):
Rich (BB code):
Sub gotosite()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
IE.Visible = True
IE.Silent = True
IE.navigate "url.com"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
End With
IE.document.getElementById("txtPolicyNumber").Value = "12345"
End Sub
The one in bold is where it crashes and gives me method 'document' of object 'iwebbrowser2' failed error. Help please!