Application.OnTime question

npanag

New Member
Joined
Jan 7, 2011
Messages
45
Hi,

I experimented in a test machine with Excel running the following commands in ThisWorkbook.Open of a workbook:


Application.OnTime TimeValue("01:35:00"), "Module1.Open_Files"
Application.OnTime TimeValue("01:50:00"), "Module1.Save_Close_Files"
Application.OnTime TimeValue("01:58:00"), "Module1.Close_App"

I read that in order to cancel these commands I must write exactly the name and the time of the procedures with Schedule Cancel:



Application.OnTime TimeValue("01:35:00"), "Module1.Open_Files", , False
Application.OnTime TimeValue("01:50:00"), "Module1.Save_Close_Files", , False
Application.OnTime TimeValue("01:58:00"), "Module1.Close_App", , False


My question is about the time: During my testing I used various time values, for example, 04:50, or 5:12 etc. Of course I don't remember all the time values I used. Will they remain active in Excel? I know that they remain even if Excel is closed and opens again.

Does Excel keep these actions after reboot of the PC?

In any case, how do I get rid of the multiple time values I used? Additionally, how can i check what OnTime actions are active for an Excel file, or for Excel itself on a specific PC?

Thank you
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I know that they remain even if Excel is closed and opens again.

No they don't. They remain active if you only close the workbook down, but once you close Excel itself, they are all gone.
 
Upvote 0
Thanks a lot.

Therefore, the Schedule Cancel parameter is meaningful only if you don't close Excel, but close only the workgroup?
 
Upvote 0
I read various sources but none of them declared the duration and the scope of the OnTime action clearly, as you did.

Thanks again
 
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,326
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top