Schedule Macro doesn't seem to run any suggestions

  • Thread starter Thread starter jk9533
  • Start date Start date
J

jk9533

Below is a scheduled macro to run everyday at 5:00 am. It doesn't seem to be
working. Does anybody know how to fix?

Sub Schedule()
Application.OnTime EarliestTime:=TimeValue("5:00 AM"),
Procedure:="RefreshDaily", Schedule:=True
End Sub

Thanks
 
Below is a scheduled macro to run everyday at 5:00 am.  It doesn't seemto be
working.  Does anybody know how to fix?

Sub Schedule()
    Application.OnTime EarliestTime:=TimeValue("5:00 AM"),
Procedure:="RefreshDaily", Schedule:=True
End Sub

Thanks

You need the date as well as the time:
Application.OnTime EarliestTime:=Date + TimeSerial(5, 0, 0) + 1
will schedule the next run tomorrow

gsnu2007k
 
If you include the line in RefreshDaily, It schedules the next entry
for tomorrow.

So the +1 is necessary!
 
Back
Top