Hi!
I Can't get this code to work. When i run it i get a RUn-time error '-2147467259 (80004005)': Method 'Document' of object 'IWebBrowser2' failed.
I seems to be something wrong with the row "Set doc = IE.document"
I have Microsoft Internet Controls and Microsoft HTML Object Library in references.
Can somebody help?
See code below
Sub test()
Dim IE As Object
Dim doc As HTMLDocument
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://.........."
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = IE.document
doc.getElementById("id-name").Value = "test"
End Sub
I Can't get this code to work. When i run it i get a RUn-time error '-2147467259 (80004005)': Method 'Document' of object 'IWebBrowser2' failed.
I seems to be something wrong with the row "Set doc = IE.document"
I have Microsoft Internet Controls and Microsoft HTML Object Library in references.
Can somebody help?
See code below
Sub test()
Dim IE As Object
Dim doc As HTMLDocument
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://.........."
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = IE.document
doc.getElementById("id-name").Value = "test"
End Sub