I've been working on this ontime method macro to schedule several daily, weekly and a monthly macros. I click the "ontime macro" once a week because my pc reboots weekly. Thru out the week my daily macros work fine. It's just the weekly, weekly_m2m and monthly that doesnt run. Can someone please tell me what's wrong with my code. I tested these macros by changing the time when i'm in front of the screen and it successfully kicks off, but as you can see i have these macros scheduled early in the morning. Why doesnt it run??
Thanks in advance.
Thanks in advance.
Code:
Sub ontime()
Application.ontime TimeValue("4:30:00"), "daily1"
Application.ontime TimeValue("5:20:00"), "daily2"
Application.ontime TimeValue("5:25:00"), "daily3"
If Weekday(Date) = vbSaturday Then
Application.ontime TimeValue("5:30:00"), "weekly"
End If
If Weekday(Date) = vbTuesday Then
Application.ontime TimeValue("5:30:00"), "weekly_m2m"
End If
If Date = DateSerial(Year(Date), Month(Date), 1) Then 'first of month
Application.ontime TimeValue("6:00:00"), "monthly"
End If
End Sub
Last edited by a moderator: