Run Macro In Closed File At Same Time Each DayOct 17, 2007
i know there is information on this ontime method, i haev read through it, but since i am working with reuters running live in the background they just dont work.
Anyway, on a normal excel sheet, I have made the automated macros run on a timer, which is great. BUT If someone switches off my pc, its not going to be so great because i dont think the macro would run without excel being open.
How can i make my macro run every morning at 8am? Assuming the worksheet is closed, even excel is closed. i am sure the answer is starring me in the face, i am just getting boerd of looking at it! in the Thisworkbook:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime dTime, "thismodule", , False
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("20:00:00"), "thismodule"
and in the Module:
dTime = Now + TimeValue("08:00:00")
Application.OnTime dTime, "thismodule"