ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel SaveAs to force overwrite of extant file (https://www.excelbanter.com/excel-programming/439488-excel-saveas-force-overwrite-extant-file.html)

Bill Armitage

Excel SaveAs to force overwrite of extant file
 
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?

Gord Dibben

Excel SaveAs to force overwrite of extant file
 
Wrap your code in

Application.DisplayAlerts = False

your save code

Application.DisplayAlerts = True


Gord Dibben MS Excel MVP

On Fri, 12 Feb 2010 11:52:01 -0800, Bill Armitage
wrote:

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?




All times are GMT +1. The time now is 03:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com