MurrayBarn
New Member
- Joined
- May 27, 2012
- Messages
- 32
- Office Version
- 365
- Platform
- Windows
Hi There
I have a short macro in a workbook (not in Personal.xlsb) that saves said workbook every ten minutes as I am using some functions that prevents Excel autosave running for some reason. It works really well but the problem is if I close said workbook, the macro keeps running. It opens the workbook and saves it every ten minutes even if closed. The only way to stop this is close Excel completely and then open up the other workbooks. It is quite annoying as I often have lots of workbooks open. Below is the code I am using. My question is is there some VBA code that will remove the below code from whatever memory Excel keeps when this particular workbook is closed?
I have a short macro in a workbook (not in Personal.xlsb) that saves said workbook every ten minutes as I am using some functions that prevents Excel autosave running for some reason. It works really well but the problem is if I close said workbook, the macro keeps running. It opens the workbook and saves it every ten minutes even if closed. The only way to stop this is close Excel completely and then open up the other workbooks. It is quite annoying as I often have lots of workbooks open. Below is the code I am using. My question is is there some VBA code that will remove the below code from whatever memory Excel keeps when this particular workbook is closed?
VBA Code:
Sub SaveThis()
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
Application.OnTime Now + TimeValue("00:10:00"), "SaveThis"
End Sub