L Leanne Jan 19, 2010 #1 Is there a way to programatically add the current date to a file name when exporting a query, table, report via a macro?
Is there a way to programatically add the current date to a file name when exporting a query, table, report via a macro?
R RonaldoOneNil Jan 19, 2010 #2 As long as the date does not contain slashes as this would affect the file path name. Below is an example of the filename in a TransferSpreadsheet command in a macro. ="C:\Temp\Test" & Format(Date(),"dd-mm-yyyy") & ".xls"
As long as the date does not contain slashes as this would affect the file path name. Below is an example of the filename in a TransferSpreadsheet command in a macro. ="C:\Temp\Test" & Format(Date(),"dd-mm-yyyy") & ".xls"
D Douglas J. Steele Jan 19, 2010 #3 Use something like "MyFile" & Format(Date, "yyyy\-mm\-dd") & ".txt" instead of just "MyFile.txt"