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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbs script wait for Internet explorer page to fully load

Status
Not open for further replies.

daillest319

Programmer
Apr 9, 2012
29
US
im trying to have the code to wait for the page to fully load before it goes on to the next command. sleep command doesnt work great since the page can sometimes take longer then the sleep timer. please can someone help me?



Code:
Dim oIE,
Set oIE = WScript.CreateObject("InternetExplorer.Application") 


oIE.Visible = true
oIE.Navigate("[URL unfurl="true"]http://www.yahoo.com")[/URL]
WScript.Sleep 10000
oIE.Document.All.Item("txtUserName").Value = "user"
oIE.Document.All.Item("txtPassword").Value = "password"
WScript.Sleep 10000
 
Replace this:
WScript.Sleep 10000
with this:
Do While oIE.Busy Or oIE.ReadyState <> 4: WScript.Sleep 100: Loop


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top