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

Wait Method in Excel

Status
Not open for further replies.

Bass71

MIS
Jun 21, 2001
79
Hi:

I am writing an automated program that captures data from the Internet and pastes into excel. In order keep the system from jumping ahead, I have to put in puases. I use the

Application.Wait Now() + TimeSerial(0, 0, 1) -which works fine, but I'd like it to move a bit more quickly, however if I put

If I use

Timer as Integer
Timer = 650
for i = 1 to 14
SendKeys "{TAB}", True
Application.Wait Timer
next i

What happens is that the cursor just speeds through and fouls up the process. Is there a better way of creating less than 1 second pauses?

THnaks...
 
Hi,

Try this...
Code:
Dim PauseTime, Start
    PauseTime = 1    ' Set duration.
    Start = Timer    ' Set start time.
    Do While Timer < Start + PauseTime
        DoEvents    ' Yield to other processes.
    Loop
    MsgBox &quot;DONE&quot;
Hope this helps :)

Skip,
Skip@TheOfficeExperts.com
 
An old fashioned way was to put in a loop that does nothing. eg.

For n = 1 to 10000
Next

Regards
BrianB
** Let us know if you get something that works !
================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top