Pausing a Running Macro

The Application object comes with a Wait method that pauses a running macro until a specified time is reached. Here's the syntax: Application.Wait(Time)

Time The time you want to macro to resume running.

For example, if you wanted your procedure to delay for about five seconds, you would use the following statement:

Application.Wait Now + TimeValue("00:00:05")

See "Running a Procedure at a Specific Time," later in this chapter, to learn more about the TimeValue function.

0 0

Post a comment