Dear Excel Guru
From Excel 2007 I upgraded my Excel to Excel 2019. The VBA code below works fine with my previous Excel but when I upgraded to the new version of Excel when I exit the program it has a message “Want to SAVE your changes…”. On the previous version it close without any prompt or message.
Your help is very much appreciated.
Thank you.
From Excel 2007 I upgraded my Excel to Excel 2019. The VBA code below works fine with my previous Excel but when I upgraded to the new version of Excel when I exit the program it has a message “Want to SAVE your changes…”. On the previous version it close without any prompt or message.
Your help is very much appreciated.
Thank you.
VBA Code:
Sub ERRClose()
Dim Backup As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.DisplayFormulaBar = True
Backup = "D:\ERR FILES\BACKUP\Kaperahan " & Format(Date, "YYYY-MM-DD") & ".xlsb"
If Len(Dir("D:\", vbDirectory)) = 0 Then
Beep
MsgBox "Please Insert the USB Drive and Try Again!"
Exit Sub
End If
Application.DisplayAlerts = False
ThisWorkbook.Save
ThisWorkbook.SaveAs Filename:=Backup
Application.DisplayAlerts = True
Application.Quit
On Error GoTo error_Handler:
error_Handler:
Application.Quit
Application.DisplayAlerts = True