|Subject:||Re: On time kill|
|Posted by:||Chip Pearson (ch…@cpearson.com)|
|Date:||Wed, 7 Jun 2006|
To cancel an OnTime event, you must provide the EXACT time that
it is scheduled to run. Therefore, you should store that value in
a public variable, and pass that variable to OnTime. E.g.,
Public RunWhen As Double
RunWhen = Now + TimeValue("00:01:00")
Application.OnTime RunWhen, "max_min"
Application.OnTime RunWhen, , , False
Microsoft MVP - Excel
Pearson Software Consulting, LLC
"Antonio" <Anton…@discussions.microsoft.com> wrote in message
>I have the following code that runs every minute
> Application.OnTime Now + TimeValue("00:01:00"), "max_min"
> I want to cancel that OnTime schedule in the Before_Close
> How can I do that. I am having difficulties with the
> Application.OnTime EarliestTime:=Now+TimeValue("00:01:00"),
> Procedure:="max_min", Schedule:=False
> does not work
> If I don't kill the call to max_min the spreadsheet keeps
> opening up or
> causing errors when it is opened.
On time kill posted by Antonio on Wed, 7 Jun 2006