Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15702

Run-time Error

$
0
0
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

Viewing all articles
Browse latest Browse all 15702

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>