When trying to delete a sheet programmatically in Excel, an alert is displayed asking you to confirm if you want to delete the sheet.

image

To remove this, you can use the following code:

Application.DisplayAlerts = False
Worksheets("Sheet1").Delete
Application.DisplayAlerts = True

The alerts will be switched off for this action and then turned on again.

This is my site Written by Tim Jolley on February 28, 2011 – 11:03 am