I want my code to 'Wait' or 'Sleep' while I am pasting things into a document. But How To Do??? I was thinking maybe count seconds? But How TO DO? Any Suggestions?
Printable View
I want my code to 'Wait' or 'Sleep' while I am pasting things into a document. But How To Do??? I was thinking maybe count seconds? But How TO DO? Any Suggestions?
You can do something like this:
Then you can call this routine like this:Code:Public Sub TimeOut(pInterval As Single)
Dim sngTimer As Single
sngTimer = Timer
Do While Timer < sngTimer + pInterval
DoEvents
Loop
End Sub
Call TimeOut 5
This will pause for 5 seconds.
Here is one way...
Sub Wait(byval time_ms as Single)
Dim TimeToWait as Single
TimeToWait = Timer + time_ms
Do: DoEvents: Loop Until (Timer >= TimeToWait)
End Sub
get the idea?