ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Turn Off Warning in Macro (https://www.excelbanter.com/excel-programming/289730-turn-off-warning-macro.html)

Ken[_18_]

Turn Off Warning in Macro
 
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?

Keith Willshaw

Turn Off Warning in Macro
 

"Ken" wrote in message
...
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



Beto[_3_]

Turn Off Warning in Macro
 
Ken wrote:

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,
--
Beto
Reply: Erase between the dot (inclusive) and the @.
Responder: Borra la frase obvia y el punto previo.



All times are GMT +1. The time now is 06:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com