Flash5
asked on
set timeout value on CreateObject("InternetExplorer.Application")
sample code:
Set myIE = CreateObject("InternetExpl orer.Appli cation")
myIE.navigate "http://demo.com"
Do Until myIE.Busy = False
DoEvents
Loop
How can i set the timeout value for the http request?
thanks
Set myIE = CreateObject("InternetExpl
myIE.navigate "http://demo.com"
Do Until myIE.Busy = False
DoEvents
Loop
How can i set the timeout value for the http request?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>How can i set the timeout value for the http request?
IE has it's own time-out so to avoid conflicts with it, you may want to change IE's time-out instead.
http://support.microsoft.com/default.aspx?scid=kb;en-us;181050
If you don't think your custom time-out will exceed IE's, the above suggestions would be better.
IE has it's own time-out so to avoid conflicts with it, you may want to change IE's time-out instead.
http://support.microsoft.com/default.aspx?scid=kb;en-us;181050
If you don't think your custom time-out will exceed IE's, the above suggestions would be better.
Dim lSeconds As Long
Dim dtStart As Date
'Set a 3 second timeout
lSeconds = 3
'Get the time before navigating
dtStart = Now
'navigate
myIE.Navigate2 "http://weather.com"
'Check the time against the start time
Do While (myIE.ReadyState <> READYSTATE_COMPLETE)
DoEvents
If (DateDiff("s", dtStart, Now) > lSeconds) Then
myIE.Stop
Debug.Print "Time Out"
Exit Do
End If
Loop