Selecting a response on a dialogue box from a Macro

C

ChemicalJasper

What is the code to select a response on a dialogue box?

I have a Macro which saves the open work book to a couple of locations
- in one of the locations it needs to be saved with the same file name
each time.

Obviously each time the macro runs, Excel opens a dialogue box asking

"Are you sure you want to Save? - this file already exists"

What code can I use to select the Yes button from the Macro?

Cheers,

Steve
 
G

Guest

Try this.
Near the top of your macro, add the line:
Application.DisplayAlerts = False

then near the end of the macro, add the line:
Application.DisplayAlerts = True
 
C

ChemicalJasper

Spot on! - Thanks very much!

Try this.
Near the top of your macro, add the line:
Application.DisplayAlerts = False

then near the end of the macro, add the line:
Application.DisplayAlerts = True
 

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