Delete Spreadsheet without Error

  • Thread starter Thread starter Mike D.
  • Start date Start date
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.
 
Possibly

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

you could try:

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

Regards

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top