Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SaveAs and always overwrite? Maury Markowitz Excel Programming 3 October 31st 05 04:16 PM
Q: overwrite during saveas JIM.H. Excel Discussion (Misc queries) 1 January 5th 05 07:27 PM
Method SaveAs with no overwrite YesNoCancel dialog Peter Pham Excel Programming 1 July 16th 04 09:28 PM
Using SaveAs Statement to overwrite existing File Peter Excel Programming 3 June 16th 04 12:27 PM
overwrite Excel SaveAs function from File menu susie Excel Programming 1 July 31st 03 04:47 AM


All times are GMT +1. The time now is 12:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"