Disable Alert (Warning) Messages in Excel

Sometimes the Excel displays a message asking if you want to continue, for example:

  • Do you want to save a file before closing?
  • Data may exist in the sheet(s) selected for deletion. To permanently delete the data, press Delete.

These alerts can be turned off by using this VBA-code:

Application.DisplayAlerts = False

After a routine you must turn on alert messages:

Application.DisplayAlerts = True