ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving a file in a macro (https://www.excelbanter.com/excel-programming/276606-saving-file-macro.html)

Eric Dreshfield

Saving a file in a macro
 
I am using the following statement to save a file:

ActiveSheet.SaveAs FileName:="c:\imports\paycheck.CSV",
FileFormat:=xlCSV, CreateBackup:=False


If the file already exists I get prompted with the
overwrite box...can I do something in the macro to
automatically overwrite the existing file ?

steve

Saving a file in a macro
 
Eric,

Use
Application.DisplayAlerts = False
*your code*
Application.DisplayAlerts = True

--
sb
"Eric Dreshfield" wrote in message
...
I am using the following statement to save a file:

ActiveSheet.SaveAs FileName:="c:\imports\paycheck.CSV",
FileFormat:=xlCSV, CreateBackup:=False


If the file already exists I get prompted with the
overwrite box...can I do something in the macro to
automatically overwrite the existing file ?




Eric Dreshfield

Saving a file in a macro
 
Steve,

Thanks !!

Eric
-----Original Message-----
Eric,

Use
Application.DisplayAlerts = False
*your code*
Application.DisplayAlerts = True

--
sb
"Eric Dreshfield" wrote in message
...
I am using the following statement to save a file:

ActiveSheet.SaveAs FileName:="c:\imports\paycheck.CSV",
FileFormat:=xlCSV, CreateBackup:=False


If the file already exists I get prompted with the
overwrite box...can I do something in the macro to
automatically overwrite the existing file ?



.



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

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