DayTraderKevin
New Member
- Joined
- Dec 23, 2022
- Messages
- 35
- Office Version
- 365
- Platform
- Windows
I found this somewhere online and placed it in ThisWorkbook...
Private Sub Workbook_Open()
Runs a macro at 6:30 AM
Application.OnTime TimeValue("18:20:01"), "GetMyData"
End Sub
It sort of works. My macro is programmed to run every minute...
myTimer = Now + TimeValue("00:01:00")
When I run Workbook_Open, it will start the macro, but sometimes the macro won't adhere to running once a minute, but goes into an immediate loop. Sometimes it will run correctly only once a minute. I'm not sure what's causing the inconsistency.
Is there a better (more consistent) way to auto-start a macro?
Private Sub Workbook_Open()
Runs a macro at 6:30 AM
Application.OnTime TimeValue("18:20:01"), "GetMyData"
End Sub
It sort of works. My macro is programmed to run every minute...
myTimer = Now + TimeValue("00:01:00")
When I run Workbook_Open, it will start the macro, but sometimes the macro won't adhere to running once a minute, but goes into an immediate loop. Sometimes it will run correctly only once a minute. I'm not sure what's causing the inconsistency.
Is there a better (more consistent) way to auto-start a macro?