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.
This example pauses for approximately 10 seconds.
newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
This example displays a message indicating whether 10 seconds have passed.
If Application.Wait(Now + TimeValue("0:00:10")) Then
MsgBox "Time expired"
This example pauses until 2:30pm the following day.
Application.Wait DateSerial(Year(),Month(),Day()-1), TimeSerial(14,30,0))
The method Application.Wait does not exist in Word at the moment
The method Application.Wait does not exist in PowerPoint at the moment
© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext