Quote:
Originally Posted by dherr
Thanks for the fast answer!
The code you show me, I have set this accurate into the module of normal.dotm. But it doesn't work.
I get the error message:
Runtime error. 4248
This order is not available, because no document is open.
What's to do?
Greetings-
Dietrich
|
Here is code to delay the execution of a macro for a given number of seconds.
Code:
Private Sub HaveABreak(iSeconds As Integer)
'
' Macro pauses running of procedure for given number of seconds
' Astrid Zeeland
' https://wordmvp.com/FAQs/MacrosVBA/ShowAllClippitAnimations.htm
'
Dim lPauseTime As Long
Dim lStart As Long
lPauseTime = iSeconds
lStart = Timer 'get current time
Do While Timer < lStart + lPauseTime
DoEvents
Loop
End Sub
Put this into the same module that would hold the AutoExec.
You would call it with HaveABreak (i) where i is the number of seconds you need to wait. Try it with 1. Insert the following into the AutoExec macro before the Show command:
HaveABreak(1)