JohnZ1156
Board Regular
- Joined
- Apr 10, 2021
- Messages
- 160
- Office Version
- 2021
- Platform
- Windows
I have an Excel Workbook with many sheets. After I enter my new data, I created a button and assigned a macro to save the file to multiple locations. Two "backup" locations and my primary location.
Even though I run the macro and it saves the file, when I go to close the workbook or exit excel, it asks me if I want to save the file again?
Here is my macro.
Even though I run the macro and it saves the file, when I go to close the workbook or exit excel, it asks me if I want to save the file again?
Here is my macro.
VBA Code:
Sub SaveAllOver()
Application.DisplayAlerts = False
ThisWorkbook.SaveAs "E:\Finance\Finances.xlsm", 52
ThisWorkbook.SaveAs "Z:\Finance\Finances.xlsm", 52
'ThisWorkbook.Save
MsgBox ("The " & Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 5) & " Workbook was saved!")
ThisWorkbook.SaveAs "C:\Users\John\Documents\Finance\Finances.xlsm", 52
Application.DisplayAlerts = True
End Sub