Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Better method for while ieobj,busy Doevents

Status
Not open for further replies.

krieg313

Technical User
May 5, 2011
22
0
0
US
Is there a better way to tell the browser to wait until a page has loaded to continue?

I've tried

while ieobj.busy
doevents
wend

do while ieobj.busy
loop

and even

variable1 = ieobj.document.all.getelementsbytagname("td").length

while ieobj.document.all.getelementsbytagname("td").length < variable1
doevents
wend

I ask this because the above methods don't work when the page is big, DOevents gets bypassed ending up giving me errors when I run my code.

Any suggestions?


 
IE fires an event when a document has is ready: DocumentComplete. be warned that a document with multiple frames will generate multiple DocumentComplete events, so you need to check which one is triggering it, eg:
Code:
[blue]Private Sub ieObj_DocumentComplete(ByVal pDisp As Object, URL As Variant)
   If (pDisp Is ieObj.Object) Then
      MsgBox "Downloaded page"
   End If
End Sub[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top