Automatic response to message box?

B

Benjamin

If every time I run a macro I get a typical message box,
can I program it to automatically respond to it?

For example, if within my macro I close a file and it asks
me if I want to save the changes, can my macro
automatically respond to the message box saying NO?
 
H

Harald Staff

No. (Yes, ok, with SendKeys, but that is extremely unreliable.) The trick is
to make the boxes NOT appear at all. That's done with

Application.DisplayAlerts = False

But then you'd better make sure your code knows what it does, like close
without saving changes, overwriteexisting file, things like that.
 

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