App Close and File No Save

  • Thread starter Thread starter Michael Kintner
  • Start date Start date
Ron,

I have found that this generally works to suppress the save warning that
Excel generates when trying to close an unsaved sheet. I now have a
situation where I want to delete an existing worksheet (from within my
Add-In code), as follows:

ActiveWorkbook.Saved = True
ActiveWorkbook.Sheets("MySheet").Delete

However, I have been unable to suppress the "Data may exist in the sheet(s)
selected for deletion. To permanently delete the data, press Delete."
warning message. I can't find anything in the knowledge base about this
message. Any idea on how to suppress it? I don't want the user to even
know that I'm deleting, and replacing, a worksheet.

Thanks.

Mark D'Agosta
 
Yeap, got that one figured out.

Use:
Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True

Mike
 
Yeap, got that one figured out.

Use:
Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True

Mike
 
Thanks Mike. That did the trick.

Mark

Michael Kintner said:
Yeap, got that one figured out.

Use:
Application.DisplayAlerts = False
' delete the sheet
Application.DisplayAlerts = True

Mike
 
Back
Top