Application.Wait Method
Excel Developer Reference |
Pauses a running macro until a specified time. Returns True if the specified time has arrived.
Syntax
expression.Wait(Time)
expression A variable that represents an Application object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Time | Required | Variant | The time at which you want the macro to resume, in Microsoft Excel date format. |
Return Value
Boolean
Remarks
The Wait method suspends all Microsoft Excel activity and may prevent you from performing other operations on your computer while Wait is in effect. However, background processes such as printing and recalculation continue.
Example
This example pauses a running macro until 6:23 P.M. today.
Visual Basic for Applications |
---|
|
This example pauses a running macro for approximately 10 seconds.
Visual Basic for Applications |
---|
|
This example displays a message indicating whether 10 seconds have passed.
Visual Basic for Applications |
---|
|
See Also