Delete Spreadsheet without Error

M

Mike D.

Hi.

I currently am deleting sheets in a macro with the command:

ActiveWindow.SelectedSheets.Delete

Each time it is executed, it prompts me with a message
that says "Data may exist ..."

How do I tell my macro to skip this?

Thanks,
Mike.
 
T

Tom Ogilvy

Possibly

application.DisplayAlerts = False
ActiveWindow.Selectedsheets.Delete
Application.DisplayAlerts = True
 
T

Trevor Shuttleworth

Mike

you could try:

Application.DisplayAlerts = False
' your code
Application.DisplayAlerts = True

Regards

Trevor
 
F

Frank Kabel

Hi
try
application.displayalerts=false
ActiveWindow.SelectedSheets.Delete
application.displayalerts=true
 
Top