Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filename with current Date()
Use the Format function to format the current date in to an
acceptable format. E.g., ActiveWorkbook.SaveAs Filename:= _ "C:\Data_" & Format(Date, "mm_dd_yyyy") & ".xls", _ FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "toothfish__" wrote in message ... Hi All, I am trying to compile a simple procedure that will name and save the current workbook with a filename that includes the system date. But my code is generating a compile error, please can you review below and let me know where I am going wrong? thanks, === ChDir _ "C:\" ActiveWorkbook.SaveAs Filename:= _ "C:\Data_"&Date()&".xls" _ , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ActiveWindow.Close === |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filename with current Date()
thanks Chip, this is great it works perfectly.
-----Original Message----- Use the Format function to format the current date in to an acceptable format. E.g., ActiveWorkbook.SaveAs Filename:= _ "C:\Data_" & Format(Date, "mm_dd_yyyy") & ".xls", _ FileFormat:=xlNormal, _ Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "toothfish__" wrote in message ... Hi All, I am trying to compile a simple procedure that will name and save the current workbook with a filename that includes the system date. But my code is generating a compile error, please can you review below and let me know where I am going wrong? thanks, === ChDir _ "C:\" ActiveWorkbook.SaveAs Filename:= _ "C:\Data_"&Date()&".xls" _ , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ActiveWindow.Close === . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I display the current XLS filename in a toolbar? | Excel Discussion (Misc queries) | |||
macro to grab current workbook filename | Excel Worksheet Functions | |||
Enter current date automatically in filename | Excel Worksheet Functions | |||
I want a cell to show the current filename automatically. | Excel Discussion (Misc queries) | |||
Append current date to filename | Excel Programming |