Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default "Go ahead and replace file" command?

I need to create a file and SaveAs a file with the same name. Will the
Alerts = False automatically tell it "Yes, replace the other file with the
same name"? Or is there another line I should add to the SaveAs code to
tell Excel to overwrite and replace the existing file?

Thanks.
Ed


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default "Go ahead and replace file" command?

Yes,
Application.DisplayAlerts = False

will allow you to overwrite the file without prompt.

Another approach is to Kill any existing file before doing the saveas

fName = "C:\Myfolder\Myfile.xls"
On Error Resume Next
Kill fName
On Error goto 0
Thisworkbook.SaveAs fName

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I need to create a file and SaveAs a file with the same name. Will the
Alerts = False automatically tell it "Yes, replace the other file with the
same name"? Or is there another line I should add to the SaveAs code to
tell Excel to overwrite and replace the existing file?

Thanks.
Ed




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default "Go ahead and replace file" command?

Thanks, Tom. I appreciate the help.

Ed

"Tom Ogilvy" wrote in message
...
Yes,
Application.DisplayAlerts = False

will allow you to overwrite the file without prompt.

Another approach is to Kill any existing file before doing the saveas

fName = "C:\Myfolder\Myfile.xls"
On Error Resume Next
Kill fName
On Error goto 0
Thisworkbook.SaveAs fName

--
Regards,
Tom Ogilvy

"Ed" wrote in message
...
I need to create a file and SaveAs a file with the same name. Will the
Alerts = False automatically tell it "Yes, replace the other file with

the
same name"? Or is there another line I should add to the SaveAs code to
tell Excel to overwrite and replace the existing file?

Thanks.
Ed






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
"Find" a wildcard as a place marker and "replace" with original va Eric Excel Discussion (Misc queries) 1 January 27th 09 06:00 PM
"FILE" command on the tool bar is missing - how do I recover it Willsecur Excel Discussion (Misc queries) 3 May 16th 07 10:24 PM
How to "Replace()" multiple characters in one VBA command line EagleOne Excel Discussion (Misc queries) 1 April 11th 07 04:12 PM
How to cancel a find & replace command "midstream"? Matt from GVA Excel Worksheet Functions 4 September 4th 06 05:47 PM
Removing "Save As" Command from an excel file. Camper Joe Excel Worksheet Functions 0 December 19th 05 03:00 PM


All times are GMT +1. The time now is 12:11 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"