N
Nigel
Hi All,
The following code (test) is being set up to establish a web link, I have
the following question about the code if anyone can help much appreciated.
1. How can I test if the internet explorer object is open / ready ? - for
example I create the ie object and then quit ie and set ie to nothing is
there a way of testing if the object exists, eg
If ie then
do this
else
do this
endif
2. On another note is it valid to test if the ie object exists before it is
created?
3. The 'wait for response' could wait a long time, how can I set a limit on
the time ? Does the Do Events statement inside the loop allow me to have
another userform control event activate, such as a cancel button to force
the ie activty to stop
TIA
Cheers
Nigel
Sub WebLink()
Set ie = CreateObject("InternetExplorer.Application")
MsgBox "IE Created"
sURL = "http://www.foo.com"
ie.Navigate sURL
'wait for response
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop
'close ie and remove memory references
ie.Quit
Set ie = Nothing
End Sub
The following code (test) is being set up to establish a web link, I have
the following question about the code if anyone can help much appreciated.
1. How can I test if the internet explorer object is open / ready ? - for
example I create the ie object and then quit ie and set ie to nothing is
there a way of testing if the object exists, eg
If ie then
do this
else
do this
endif
2. On another note is it valid to test if the ie object exists before it is
created?
3. The 'wait for response' could wait a long time, how can I set a limit on
the time ? Does the Do Events statement inside the loop allow me to have
another userform control event activate, such as a cancel button to force
the ie activty to stop
TIA
Cheers
Nigel
Sub WebLink()
Set ie = CreateObject("InternetExplorer.Application")
MsgBox "IE Created"
sURL = "http://www.foo.com"
ie.Navigate sURL
'wait for response
Do Until Not ie.Busy And ie.ReadyState = 4
DoEvents
Loop
'close ie and remove memory references
ie.Quit
Set ie = Nothing
End Sub