VBA to sidestep popups...

  • Thread starter Thread starter Colin Hayes
  • Start date Start date
C

Colin Hayes

Hi All

As part of a macro , I use this command :

ActiveWindow.SelectedSheets.Delete

On each occasion I run it , I get a popup which ask me if I really want
to delete the relevant sheet. This brings the whole macro to a halt.

Is there a command I can use to avoid the popup , and have the macro
perform the deletion without stopping the whole routine?

Grateful for any help.



Best Wishes
 
Application.displayalerts = false
'your code here
application.displayalerts = true
 
Try it this way...

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True
 
application.dispayalerts = false
ActiveWindow.SelectedSheets.Delete
application.displayalerts = true
 
Rick Rothstein said:
Try it this way...

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True


Hi All

OK Thanks for the suggestions - that's fixed it. No more popup.

Thanks.
 
Back
Top