Excel SaveFile YesNoCanel box

In VBA how do I force answer Yes each time I want to save a file.  I have a file that I save to multiple locations and I want it to not need that question answered each time.  Can this be done?  -R-
FileSaveYesNoCancel.png
RWayneHAsked:
Who is Participating?
 
Glenn RayConnect With a Mentor Excel VBA DeveloperCommented:
In VBA, add the following line of code early in the macro:

Application.DisplayAlerts = False

This will disable overwrite messages such as above.

You also need turn this back on before exit.
Application.DisplayAlerts = True
0
 
effesConnect With a Mentor Commented:
Have a look at his: http://www.vbforums.com/showthread.php?t=528826

Hope that helps.
0
 
RWayneHAuthor Commented:
Thanks!!  Will this work when deleting sheet tabs too?  -R-
0
 
Glenn RayExcel VBA DeveloperCommented:
RE: Deleting sheet tabs...yes, it will.

That's why you have to be careful with this function.  If it remains FALSE, you can bypass messages during your Excel session that might prevent accidental overwriting/deletion.
0
 
RWayneHAuthor Commented:
Thanks for the help. -R-
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.