Automating responses to Message Boxes in Visual Basic

N

Nigel Smith

I am writing a macro that opens a specified file and
temporarily places data in it. I want to be able to
automatically close the file without saving the changes.

At present, when the Macro reaches the
activeworkbook.close function, Excel effectively "jumps
out" of the Macro until the user responds Yes/No/Cancel to
the "Save Changes" message box, at which point the macro
continues.

Is there anyway of automating this response?
 

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