ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Running Ontime's procedure while another function is running? (https://www.excelbanter.com/excel-programming/389138-running-ontimes-procedure-while-another-function-running.html)

Enter The

Running Ontime's procedure while another function is running?
 
Hi,

Is it possible to get the procedure called by onTime (which I'll refer
to as the onTime procedure) to run while another is still going?

My program needs to wait for the onTime procedure to complete and is
looping infinitely, with doevents, while it waits (please don't ask
why I'm doing this stupidity, it's due to a 3rd party tool). It would
run the onTime procedure, during the loop, earlier today. But this
afternoon it's just stopped. And the onTime procedure only runs if I
press the "stop" or "pause" buttons in VBA.

Thanks,

Enter


NickHK

Running Ontime's procedure while another function is running?
 

According to Help on the OnTime method:
"LatestTime
Optional Variant. The latest time at which the procedure can be run. For
example, if LatestTime is set to EarliestTime + 30 and Microsoft Excel is
not in Ready, Copy, Cut, or Find mode at EarliestTime because another
procedure is running, Microsoft Excel will wait 30 seconds for the first
procedure to complete. If Microsoft Excel is not in Ready mode within 30
seconds, the procedure won't be run. If this argument is omitted, Microsoft
Excel will wait until the procedure can be run."

So, as I see it, unless you can put Excel into one of the required states,
OnTime will never fire.
You need to avoid the infinite loop or find another way to initiate that
code.
Maybe some event from this "3rd party tool" ?

NickHK

"Enter The" wrote in message
ps.com...
Hi,

Is it possible to get the procedure called by onTime (which I'll refer
to as the onTime procedure) to run while another is still going?

My program needs to wait for the onTime procedure to complete and is
looping infinitely, with doevents, while it waits (please don't ask
why I'm doing this stupidity, it's due to a 3rd party tool). It would
run the onTime procedure, during the loop, earlier today. But this
afternoon it's just stopped. And the onTime procedure only runs if I
press the "stop" or "pause" buttons in VBA.

Thanks,

Enter





All times are GMT +1. The time now is 06:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com