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

vba running too fast

Status
Not open for further replies.

vzachin

Technical User
Feb 10, 2006
305
0
0
US
hi,
i'm currently using vba to manipulate data in extra but the code is running too quickly. is there any way to slow down my macro?

i added the following
Sess0.Screen.WaitHostQuiet (5000)
to my code but it doesn't help too much

thanks
 
You need to "look" for something on each screen change. the WaitForString method is very helpful.

Alternately you can use the OIA object to wait for the XClock to disappear.

Do while Sess0.screen.OIA.Xstatus <> 0
Doevents
Loop

calculus
 
You can also always do a wscript.sleep(integer) where integer is the number of miliseconds you want to wait.
 
I have used calculus' method in the past instead of the Sess0.Screen.WaitHostQuiet for some macros which I had similar probelms with and it worked great.

I usually do use the Sess0.Screen.WaitHostQuiet method but find some applications in extra a bit tempermental and require calculus' method!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top