Application.Wait
Excel
Pauses a running macro until a specified date and time.
Returns True when the specified date and time has arrived.
The Wait method suspends all Microsoft Excel activity and will prevent you from performing other operations on your computer.
Background processes (such as printing and recalculation) will continue to work.
expression.Wait(Date + Time)
This example pauses until 6:23 P.M. today.
Application.Wait "18:23:00"
This example pauses for approximately 10 seconds.
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
This example displays a message indicating whether 10 seconds have passed.
If Application.Wait(Now + TimeValue("0:00:10")) Then
MsgBox "Time expired"
End If
This example pauses until 2:30pm the following day.
Application.Wait DateSerial(Year(),Month(),Day()-1), TimeSerial(14,30,0))
Word
The method Application.Wait does not exist in Word at the moment
PowerPoint
The method Application.Wait does not exist in PowerPoint at the moment
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext