ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can't Set DisplayAlerts to False (https://www.excelbanter.com/excel-programming/293896-cant-set-displayalerts-false.html)

Mark Driscol

Can't Set DisplayAlerts to False
 
Windows XP, Excel 2003

After booting up, I put the following code in a module.

Sub A()

Application.DisplayAlerts = False
Stop

End Sub

When the macro stops at the Stop statement, I type
?Application.DisplayAlerts in the immediate window and get the answer
"True". It happens every time. I can't ever set DisplayAlerts to False in
any macro at any time.

Any ideas on what is wrong?

Thank you.

Mark




Trevor Shuttleworth

Can't Set DisplayAlerts to False
 
Mark

try it like this:

Sub A()

Application.DisplayAlerts = False
MsgBox Application.DisplayAlerts
Application.DisplayAlerts = True
Stop

End Sub

Regards

Trevor


"Mark Driscol" wrote in message
...
Windows XP, Excel 2003

After booting up, I put the following code in a module.

Sub A()

Application.DisplayAlerts = False
Stop

End Sub

When the macro stops at the Stop statement, I type
?Application.DisplayAlerts in the immediate window and get the answer
"True". It happens every time. I can't ever set DisplayAlerts to False

in
any macro at any time.

Any ideas on what is wrong?

Thank you.

Mark






Bob Phillips[_6_]

Can't Set DisplayAlerts to False
 
This is because the displayalerts resets when the code finishes.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mark Driscol" wrote in message
...
Windows XP, Excel 2003

After booting up, I put the following code in a module.

Sub A()

Application.DisplayAlerts = False
Stop

End Sub

When the macro stops at the Stop statement, I type
?Application.DisplayAlerts in the immediate window and get the answer
"True". It happens every time. I can't ever set DisplayAlerts to False

in
any macro at any time.

Any ideas on what is wrong?

Thank you.

Mark







All times are GMT +1. The time now is 03:44 PM.

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