I created a macro that refreshes the data automatically and then it saves the file to a particular folder. I would like to set up a scheduled job that automatically runs my macro every Monday morning.
How can I achieve this?
In the workbook that runs your Macro make sure it is called in the ThisWorkbook
Module Workbook_Open
Private Sub Workbook_Open()
Call YourMacroHere
End Sub
Then go to Task Scheduler
and select Create Basic Task
Then give your task a name
Click Next
and define your schedule
-> Next ->
-> Next -> Start a Program
-> Next -> Browse
and select your workbook
-> Next -> Confirm everything is correct and Finish
This will then, provided your computer is turned on will then open that Workbook every Monday at 9am. The Workbook_Open()
event will then fire executing your macro. You may want to add to your code as well to shutdown the workbook after the macro has finished.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.