Pop up message control using macros

P

Pete Davis

Hi All

Is it possible to respond to pop up messages with a
macro? Im trying to respond to the two following pop ups,
which are generated by activities carried out by the
macro:

1. File already exists. Replace? Yes or No? (Im using the
macro to save an updated version of an existing file). In
this case, I would like the macro to respond with a YES>
2. Large amount of data exists on clipboard. Do you want
data to be available.......Yes or No? (Im using the macro
to close a file which ive copied a large amount of data
from.) In this case, I would like the macro to respond
with a NO.

In Macro Record mode, I responded to each message, but no
code of anykind was copied into the macro.

I dont want the user to be inconvenienced with having to
respond to these messages.

Thanks for any advice.

Pete
 
J

Jesse Hamilton

Try adding:

Application.DisplayAlerts = False

Above your code. This will make it just overwrite without asking unless the
target file is read only.

I'm not sure but that might cause the second one to not show as well.

Jesse Hamilton
 

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