Hi All,
I have a spreadsheet that I would like to have auto save before closing.
I have the below code, It says it is saving but when I go back into the spreadsheet it hasn't, can anyone help at all?
I have a spreadsheet that I would like to have auto save before closing.
I have the below code, It says it is saving but when I go back into the spreadsheet it hasn't, can anyone help at all?
Code:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
NEW_NAME = ActiveWorkbook.Name
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:="Z:\STAFF HOLIDAY CHARTS" & NEW_NAME, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False, ConflictResolution:=1
Application.DisplayAlerts = True
End Sub