April 2006
Beginner
1114 pages
98h 16m
English
Application.Wait(Time)
Pauses Excel.
|
Argument |
Setting |
|---|---|
|
|
The time to resume Excel |
You can specify an interval of time to wait by incrementing Now. The following code uses that technique to create a procedure that pauses for an interval specified in milliseconds (the same as the Windows API Sleep function):
Sub TestSleep( )
' Wait 5 seconds.
Sleep 5000
MsgBox "Time's up!"
End Sub
Sub Sleep(milsecs As Long)
Dim dt As Date
' 0.00001 = 1 second in the Date type.
dt = Now + (milsecs / 100000000)
Application.Wait (dt)
End SubRead now
Unlock full access