Automatic response to message box?

  • Thread starter Thread starter Benjamin
  • Start date Start date
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?
 
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.
 
Back
Top