Delay the macro for specified seconds

B

Boba

Hello,

I couldn't find the procedure's name of the delay. Can
someone tell me what is the procedure's name of delay ?
My purpose is to delay the macro for X seconds.

Thanks.
 
H

Helmut Weber

Hi,

Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds
As Long)

Or if you prefer something simple, not to say primitive:

Public Sub Wait(ByVal aNum As Integer)

Dim aTim As Single
aTim = Timer
While Timer < aTim + aNum
DoEvents
Wend
End Sub

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
Top