Excel SaveAs to force overwrite of extant file

  • Thread starter Thread starter Bill Armitage
  • Start date Start date
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?
 
Wrap your code in

Application.DisplayAlerts = False

your save code

Application.DisplayAlerts = True


Gord Dibben MS Excel MVP
 
Back
Top