Turn Off Warning in Macro

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

We have a macro in which we are deleting a worksheet. When
the code gets to that point, the user gets a warning
message about permanently deleting the worksheet.

How do we turn off that warning in the macro?
Do we need to turn the warnings back on before we close
the macro?
 
Ken said:
We have a macro in which we are deleting a worksheet. When
the code gets to that point, the user gets a warning
message about permanently deleting the worksheet.

How do we turn off that warning in the macro?

Application.DisplayAlerts = False
Do we need to turn the warnings back on before we close
the macro?

Application.DisplayAlerts = True

Keith
 
Ken said:
We have a macro in which we are deleting a worksheet. When
the code gets to that point, the user gets a warning
message about permanently deleting the worksheet.

How do we turn off that warning in the macro?
Do we need to turn the warnings back on before we close
the macro?

Not sure if this is waht you need but try with

Application.DisplayAlerts = False

and set it back to true before closing the macro, otherwise none of the
excel alerts will display.

Regards,
 
Back
Top