Application.OnTime Stopping

clemscot

New Member
Joined
Dec 27, 2014
Messages
2
So I created the below schedule and within the ThisWorkbook Object. The schedule worked effectively (when excel wouldnt get closed due to system restart or some other reason). However after 5 days the schedule just stopped firing. Isolated events and times for launch and ensured that this sub was the active code and, nothing.

Tried the same file on multiple boxes to no avail. I understand Application.OnTime is fickle and its state must be set to false when closing (this is for a whole other topic as I have been frustrated as can be with this) or it will continue to launch multiple executions of the same command - hopefully MS will come up with a better solution to scheduling needs.

There is nothing wrong with any of the subroutines that are called as I can executed them manually with no issues. My only resolution was to create an entirely new file. I imported all objects (sheets and modules) and simply cut/paste the below schedule into the new ThisWorkbook object - boom, it worked fine - ugh!

Any one else out there encountered this and have you discovered any cause for it to just stop working?



Private Sub Workbook_Open()

'This schedule creates the FULL 24 Hour file
Application.OnTime TimeValue("00:00:00"), "Rodeodata00"
Application.OnTime TimeValue("01:00:00"), "RodeoData01"
Application.OnTime TimeValue("02:00:00"), "RodeoData02"
Application.OnTime TimeValue("03:00:00"), "RodeoData03"
Application.OnTime TimeValue("04:00:00"), "RodeoData04"
Application.OnTime TimeValue("05:00:00"), "RodeoData05"
Application.OnTime TimeValue("06:00:00"), "RodeoData06"
Application.OnTime TimeValue("07:00:00"), "RodeoData07"
Application.OnTime TimeValue("08:00:00"), "RodeoData08"
Application.OnTime TimeValue("09:00:00"), "RodeoData09"
Application.OnTime TimeValue("10:00:00"), "RodeoData10"
Application.OnTime TimeValue("11:00:00"), "RodeoData11"
Application.OnTime TimeValue("12:00:00"), "RodeoData12"
Application.OnTime TimeValue("13:00:00"), "RodeoData13"
Application.OnTime TimeValue("14:00:00"), "RodeoData14"
Application.OnTime TimeValue("15:00:00"), "RodeoData15"
Application.OnTime TimeValue("16:00:00"), "RodeoData16"
Application.OnTime TimeValue("17:00:00"), "RodeoData17"
Application.OnTime TimeValue("18:00:00"), "RodeoData18"
Application.OnTime TimeValue("19:00:00"), "RodeoData19"
Application.OnTime TimeValue("20:00:00"), "RodeoData20"
Application.OnTime TimeValue("21:00:00"), "RodeoData21"
Application.OnTime TimeValue("22:00:00"), "RodeoData22"
Application.OnTime TimeValue("23:00:00"), "RodeoData23"



'This schedule creates the current shift file - DAYS
Application.OnTime TimeValue("06:32:00"), "ShiftRodeoData1"
Application.OnTime TimeValue("07:00:00"), "ShiftRodeoData2"
Application.OnTime TimeValue("08:00:00"), "ShiftRodeoData3"
Application.OnTime TimeValue("09:00:00"), "ShiftRodeoData4"
Application.OnTime TimeValue("10:05:00"), "ShiftRodeoData5"
Application.OnTime TimeValue("11:03:00"), "ShiftRodeoData6"
Application.OnTime TimeValue("12:00:00"), "ShiftRodeoData7"
Application.OnTime TimeValue("13:00:00"), "ShiftRodeoData8"
Application.OnTime TimeValue("14:00:00"), "ShiftRodeoData9"
Application.OnTime TimeValue("15:00:00"), "ShiftRodeoData10"
Application.OnTime TimeValue("16:00:00"), "ShiftRodeoData11"
Application.OnTime TimeValue("17:00:00"), "ShiftRodeoData12"
Application.OnTime TimeValue("18:00:00"), "ShiftRodeoData13"

'This schedule creates the current shift file - NIGHTS
Application.OnTime TimeValue("18:30:00"), "ShiftRodeoData1"
Application.OnTime TimeValue("19:00:00"), "ShiftRodeoData2"
Application.OnTime TimeValue("20:00:00"), "ShiftRodeoData3"
Application.OnTime TimeValue("21:00:00"), "ShiftRodeoData4"
Application.OnTime TimeValue("22:00:00"), "ShiftRodeoData5"
Application.OnTime TimeValue("23:00:00"), "ShiftRodeoData6"
Application.OnTime TimeValue("00:00:00"), "ShiftRodeoData7"
Application.OnTime TimeValue("01:00:00"), "ShiftRodeoData8"
Application.OnTime TimeValue("02:00:00"), "ShiftRodeoData9"
Application.OnTime TimeValue("03:00:00"), "ShiftRodeoData10"
Application.OnTime TimeValue("04:00:00"), "ShiftRodeoData11"
Application.OnTime TimeValue("05:00:00"), "ShiftRodeoData12"
Application.OnTime TimeValue("06:00:00"), "ShiftRodeoData13"

End Sub
 

Forum statistics

Threads
1,082,048
Messages
5,362,890
Members
400,696
Latest member
Kclynn

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top