Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

VB Wait

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MarkHear1 - 08 Dec 2006 14:48 GMT
Hi All (again),

I now am faced with trying to make my macro wait for the new page to
finish loading when an option is selected.

My macro looks like this:

Dim ie As Object

Set ie = CreateObject("InternetExplorer.Application")

With ie
.Navigate "URL"
.Visible = True
Do Until .ReadyState = 4
DoEvents
Loop
End With

Set ipf = ie.Document.all.Item("p1_command")
ipf.Value = "my user name"
Set ipf = ie.Document.all.Item("pw1_command")
ipf.Value = "my password "
SendKeys "{ENTER}"

***Application.Wait Now + TimeValue("00:00:3")***
SendKeys "{Tab 2}", True
SendKeys "{ENTER}"

The line surrounded in *'s is the line i would like to change to make
check that the page has fully loaded rather than working on a timer.
If anybody can offer me some help i would appreciate it greatly!

Thank you,
Mark
Dave Miller - 08 Dec 2006 16:54 GMT
Mark,

Just add another loop, replace the application.wait line with this
loop:

Do Until ie.ReadyState = 4
     DoEvents
Loop

David Miller

MarkHear1 wote:
> Hi All (again),
>
[quoted text clipped - 31 lines]
> Thank you,
> Mark
MarkHear1 - 08 Dec 2006 19:42 GMT
Hi Dave,

Thank you for this suggestion.
Unfortunately i won't be able to test it out until Monday now.
Will this work even if the button is question has opened a new window
and it's the new window that needs to finish loading?

Thanks,
Mark

> Mark,
>
[quoted text clipped - 43 lines]
> > Thank you,
> > Mark

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.