Answering Pop questions when macro is running

M

mmiazga

I have a macro which takes 15 min. to run. At various times while the macro
is running a popup box will appear and ask "A file named k:\abc.prn already
exits at this location. Do you want to replace it?" Yes No Cancel then
another one pops up "Do you want to save the changes......" Yes No Cancel. I
have 15 various pop ups which appear. My answers will always be the same for
each pop up but how do I automate it so it always answers the questions for
me and I don't have to sit and wait to answer each question as they pop up?
 
J

JP

Put the following before the message box:

Application.DisplayAlerts = False

and after the message box:

Application.DisplayAlerts = True

This will choose the default answer for the message box, so make sure
you are setting the default button appropriately.

--JP
 
J

Joel

YOu need to add an opion it the macro at the beginning to use default values
or wait for respnse. Then modify the maco to handle the two options. YO
could make an array of answers so you can easily change the options or even
get the responses from a file. But the code would have to be modified.
there is no easy way of feeding the response automatically into the boxes.
 

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