av8tordude
05-30-2011, 08:19 PM
I have this code that opens my site and clicks a paypal link on my site to open PayPal. It works well, but I ran into a problem that if the browser opens, but does not load, the code hangs, and locks up. Can someone assist with editing this code that will allow me to break or stop the code.
thanks
Sub PayPal()
Dim objExcel
Dim objIE
Dim varForm
Dim URL
Set objExcel = ActiveWindow.ActiveSheet
URL = "mysite.com"
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = False 'set to true when debugging. Keep it hidden for the moment.
With objIE
.Navigate URL
End With
While objIE.Busy
Wend
While objIE.document.ReadyState <> "complete"
Wend
Set varForm = objIE.document.forms(0)
varForm.submit
frmActivate.Height = 418
DemoProgress1
While objIE.Busy 'wait for internet explorer to stop doing whatever it is it might doing...
Wend
apiShowWindow objIE.hwnd, SW_MAXIMIZE 'set to true to show website.
objIE.Visible = 1
Set objIE = Nothing
End Sub
thanks
Sub PayPal()
Dim objExcel
Dim objIE
Dim varForm
Dim URL
Set objExcel = ActiveWindow.ActiveSheet
URL = "mysite.com"
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = False 'set to true when debugging. Keep it hidden for the moment.
With objIE
.Navigate URL
End With
While objIE.Busy
Wend
While objIE.document.ReadyState <> "complete"
Wend
Set varForm = objIE.document.forms(0)
varForm.submit
frmActivate.Height = 418
DemoProgress1
While objIE.Busy 'wait for internet explorer to stop doing whatever it is it might doing...
Wend
apiShowWindow objIE.hwnd, SW_MAXIMIZE 'set to true to show website.
objIE.Visible = 1
Set objIE = Nothing
End Sub