Excel SaveAs to force overwrite of extant file

B

Bill Armitage

I'm using Excel 2007 in 2003 compatibility mode. I have a VBA macro that
saves a dynamic file name using SaveAs, but the file name may or may not
already exist. I wish to force the SaveAs command to overwrite any
pre-existing file automatically (without user intervention to confirm that I
wish to overwrite the extant file). I'm sure I could do this in Excel 2003
but can I do it in Excel 2007 and in compatibility mode?
 
G

Gord Dibben

Wrap your code in

Application.DisplayAlerts = False

your save code

Application.DisplayAlerts = True


Gord Dibben MS Excel MVP
 

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