Exit without prompt problem

gemini528

Board Regular
Joined
Jun 13, 2013
Messages
53
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.

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
 
As this is a completely different question, you will need to start a new thread. Thanks.
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top