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/294485-re-cant-set-displayalerts-false.html)

Mark Driscol

Can't Set DisplayAlerts to False
 
Again, sorry, I can't see my previous posts.

I understand that when the macro has finished, DisplayAlerts is reset.
However, in my code below I am testing at the "Stop" statement, before the
macro has finished. DisplayAlerts at that point should be False, but it is
still True according to a query in the Immediate Window. That's the part I
don't understand.

Thanks.

Sub A()
Application.DisplayAlerts = False
Stop ' Testing in the Immediate Window at this point indicates
DisplayAlerts = True
End Sub


"Mark Driscol" wrote in message news:...
Sorry, I can't see my original post. There was one repy as follows. Can
anyone tell my why this would indicate that Application.DisplayAlerts

gives
"False," but my original one (checking via the Immediate Window) gives
"True"? Thanks.

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 news:...
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 11:11 AM.

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