Morning,
I have the below code to fire a macro at set times in the day to coincide with a datalink that refreshes just before. However, I have to close and re-open the workbook every morning to start the sequence again. Is there a way to keep these times on a loop to ensure that I can leave the book open indefinately and the macros still fire?
I have the below code to fire a macro at set times in the day to coincide with a datalink that refreshes just before. However, I have to close and re-open the workbook every morning to start the sequence again. Is there a way to keep these times on a loop to ensure that I can leave the book open indefinately and the macros still fire?
VBA Code:
Private Sub Workbook_Open()
Application.OnTime TimeValue("09:05:05"), "OpenLatestFile"
Application.OnTime TimeValue("10:05:05"), "OpenLatestFile"
Application.OnTime TimeValue("11:05:05"), "OpenLatestFile"
Application.OnTime TimeValue("12:05:05"), "OpenLatestFile"
Application.OnTime TimeValue("13:05:05"), "OpenLatestFile"
Application.OnTime TimeValue("14:05:05"), "OpenLatestFile"
Application.OnTime TimeValue("15:05:05"), "OpenLatestFile"
Application.OnTime TimeValue("16:05:05"), "OpenLatestFile"
Application.OnTime TimeValue("17:05:05"), "OpenLatestFile"
End Sub