ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Application.DisplayAlerts (https://www.excelbanter.com/excel-programming/385282-application-displayalerts.html)

OlieH

Application.DisplayAlerts
 
mI have at the end of my macro the following:
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.quit

When I step through the first two statements they both stay "True"
How have I blocked by ability to reset this parameter?
The results is when I run the Application.Quit, the Macro window open and
then closes.
All help is greatly appreciated. Thank you.

Tom Ogilvy

Application.DisplayAlerts
 
Stepping through code will likely have a different effect than running your
macro normally. Do you have this problem when you run the code normally?

--
Regards,
Tom Ogilvy



"OlieH" wrote:

mI have at the end of my macro the following:
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.quit

When I step through the first two statements they both stay "True"
How have I blocked by ability to reset this parameter?
The results is when I run the Application.Quit, the Macro window open and
then closes.
All help is greatly appreciated. Thank you.


OlieH

Application.DisplayAlerts
 
Yes. What I have done is to add
On Error Resume Next this does allow the program to close without display.
Since I am trying to quit the program, I dont care if I get errors at this
point.
I am still perplexed why I can't set these to "False" however.

"Tom Ogilvy" wrote:

Stepping through code will likely have a different effect than running your
macro normally. Do you have this problem when you run the code normally?

--
Regards,
Tom Ogilvy



"OlieH" wrote:

mI have at the end of my macro the following:
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.quit

When I step through the first two statements they both stay "True"
How have I blocked by ability to reset this parameter?
The results is when I run the Application.Quit, the Macro window open and
then closes.
All help is greatly appreciated. Thank you.


Tom Ogilvy

Application.DisplayAlerts
 
If

On error resume next

is the solution, then the promp you are getting is an error prompt and has
nothing to do with those settings. They probably are being set as you
specify them - but even if they were false, they would not suppress and
error.

--
Regards,
Tom Ogilvy

"OlieH" wrote in message
...
Yes. What I have done is to add
On Error Resume Next this does allow the program to close without
display.
Since I am trying to quit the program, I dont care if I get errors at this
point.
I am still perplexed why I can't set these to "False" however.

"Tom Ogilvy" wrote:

Stepping through code will likely have a different effect than running
your
macro normally. Do you have this problem when you run the code
normally?

--
Regards,
Tom Ogilvy



"OlieH" wrote:

mI have at the end of my macro the following:
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.quit

When I step through the first two statements they both stay "True"
How have I blocked by ability to reset this parameter?
The results is when I run the Application.Quit, the Macro window open
and
then closes.
All help is greatly appreciated. Thank you.




NickHK

Application.DisplayAlerts
 
..DisplayAlerts means just that; whether to display those <helpful message
from Excel.

This is completely different from the error messages that you seem to see,
which are raised because of problems with your code.
It is generally not a good idea to use Resume Next to ignore errors, unless
you know/expect what is happening and you are dealing with it.

Sounds like you should fix your code.

..ScreenUpdating is always True in Break/debug mode.

NickHK

"OlieH" wrote in message
...
Yes. What I have done is to add
On Error Resume Next this does allow the program to close without

display.
Since I am trying to quit the program, I dont care if I get errors at this
point.
I am still perplexed why I can't set these to "False" however.

"Tom Ogilvy" wrote:

Stepping through code will likely have a different effect than running

your
macro normally. Do you have this problem when you run the code

normally?

--
Regards,
Tom Ogilvy



"OlieH" wrote:

mI have at the end of my macro the following:
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.quit

When I step through the first two statements they both stay "True"
How have I blocked by ability to reset this parameter?
The results is when I run the Application.Quit, the Macro window open

and
then closes.
All help is greatly appreciated. Thank you.




OlieH

Application.DisplayAlerts
 
Thank you both very much. The errors occure when I am trying
"Application.quit" so I really want to ignore the problem, if I can't
determine what it is. The work has been accomplished at this time.
Thanks again.

"NickHK" wrote:

..DisplayAlerts means just that; whether to display those <helpful message
from Excel.

This is completely different from the error messages that you seem to see,
which are raised because of problems with your code.
It is generally not a good idea to use Resume Next to ignore errors, unless
you know/expect what is happening and you are dealing with it.

Sounds like you should fix your code.

..ScreenUpdating is always True in Break/debug mode.

NickHK

"OlieH" wrote in message
...
Yes. What I have done is to add
On Error Resume Next this does allow the program to close without

display.
Since I am trying to quit the program, I dont care if I get errors at this
point.
I am still perplexed why I can't set these to "False" however.

"Tom Ogilvy" wrote:

Stepping through code will likely have a different effect than running

your
macro normally. Do you have this problem when you run the code

normally?

--
Regards,
Tom Ogilvy



"OlieH" wrote:

mI have at the end of my macro the following:
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Application.quit

When I step through the first two statements they both stay "True"
How have I blocked by ability to reset this parameter?
The results is when I run the Application.Quit, the Macro window open

and
then closes.
All help is greatly appreciated. Thank you.






All times are GMT +1. The time now is 11:36 PM.

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