VBA Execution Delay Function - BCP

B

BCP

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.
 
J

John Nurick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top