Hello,
I'm trying get a simple program to run, where I navigate to a certain website in Internet Explorer, go home and then just go back to previous page.
The code:
The strange thing is, it works in debug mode (single-step) but not in normal mode. I keep getting the error like: "method GoBack of object 'iwebbrowser2' failed"
My poor waiting-loops are working (they wait a few seconds)
Any ideas?
Thank you!
I'm trying get a simple program to run, where I navigate to a certain website in Internet Explorer, go home and then just go back to previous page.
The code:
Code:
Sub testsub()
my_url = "http://www.google.de"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate my_url
.Top = 50
.Left = 530
.Height = 400
.Width = 400
End With
Do Until Not ie.Busy
DoEvents
Loop
'wait
For i = 0 To 500000000
Next i
ie.GoHome
'wait
For i = 0 To 500000000
Next i
ie.GoBack
End Sub
The strange thing is, it works in debug mode (single-step) but not in normal mode. I keep getting the error like: "method GoBack of object 'iwebbrowser2' failed"
My poor waiting-loops are working (they wait a few seconds)
Any ideas?
Thank you!