VBA Execution Delay Function - BCP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a "canned" function to hold processing in a Module? I have a module
that kicks off an external process in a loop and it needs wait for a couple
of seconds between executions. I know I can have the job go off and do some
busywork but I would prefer to use a built in function if one exists.
 
Something along these lines, perhaps:

Const TIME_TO_WAIT As Double = 2 / 86400
Dim dtWhen As Date

...
dtWhen = DateAdd("s", 2, Now())
Do
DoEvents
Loop Until Now() > dtWhen
 
Back
Top