Application.DisplayAlerts

O

OlieH

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.
 
T

Tom Ogilvy

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?
 
O

OlieH

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.
 
T

Tom Ogilvy

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.
 
N

NickHK

..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
 
O

OlieH

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top