ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   automatic overwrite file (https://www.excelbanter.com/excel-programming/309600-automatic-overwrite-file.html)

S.E.

automatic overwrite file
 
I am using the following code to save the Workbook with a new name. I want
to overwrite the old file by the same name. I would like to avoid getting
the dialog box asking if I want to replace "Latest Import.csv". Is there a
way to simply replace it without the dialog box?


Sheets("Manipulation").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Scott\My Documents\Latest Import.csv" _
, FileFormat:=xlCSV, CreateBackup:=False

Thank you in advance,
Scott



Paul B[_6_]

automatic overwrite file
 
Scott, use this

Application.DisplayAlerts = False
'Your Code
Application.DisplayAlerts = True


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **
"S.E." wrote in message
...
I am using the following code to save the Workbook with a new name. I want
to overwrite the old file by the same name. I would like to avoid getting
the dialog box asking if I want to replace "Latest Import.csv". Is there a
way to simply replace it without the dialog box?


Sheets("Manipulation").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Scott\My Documents\Latest Import.csv" _
, FileFormat:=xlCSV, CreateBackup:=False

Thank you in advance,
Scott





Tom Ogilvy

automatic overwrite file
 
Sheets("Manipulation").Select
Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Scott\My Documents\Latest Import.csv" _
, FileFormat:=xlCSV, CreateBackup:=False
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy


"S.E." wrote in message
...
I am using the following code to save the Workbook with a new name. I want
to overwrite the old file by the same name. I would like to avoid getting
the dialog box asking if I want to replace "Latest Import.csv". Is there a
way to simply replace it without the dialog box?


Sheets("Manipulation").Select
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Scott\My Documents\Latest Import.csv" _
, FileFormat:=xlCSV, CreateBackup:=False

Thank you in advance,
Scott






All times are GMT +1. The time now is 10:54 PM.

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