I have a macro that runs a command prompt if an executable is available. The macro waits 5 minutes before checking to see if an executable is available. The problem is that this locks excel. What I would prefer to do is pass control back to the user for five minutes.
This is what the bit of code looks like at the moment.
Do Until TuflowEx < Range("Exe").Value ' Check if number of executables running is less than the user specified maximum
Application.Wait (Now + TimeValue("0:05:00")) ' Wait 5 minutes before checking again
TuflowEx = TuEx() ' Run TuEx to get the currently active number of executables
Loop
Cheers
Use Application.Ontime instead.
Just create a routine to do the check, and have it resume your logic if the check succeeds.