Export to Excell with Date Extention

C

cjaaron

I'm trying to write a Macro to export a table to Excel. I want to name the
file so it has the current date in the file name (date the file is created or
Macro is ran) i.e. "AccessReportFile 20061026.xls".

I can't find this anywhere in Access or Excel help menu.
 
S

Steve Schapel

Cjaaron,

="C:\FolderName\AccessReportFile " & Format(Date(),"yyyymmdd") & ".xls"
 
C

cjaaron

Steve, I still can't get a table to export to an Excel table with date in the
Excel File Name. I also tried Transfere Spreadsheet command - no luck...
Here is my file name: T:\REPORTS\Affordable Housing Contracts
"&Format(Date()," mm-dd-yy") &".xls

I receive Failure Creating File error message.

TIA for your help!
 
S

Steve Schapel

Cjaaron,

You'll need to do it in the format I suggested. Your example is missing
the = and missing some "s and missing some spoaces and has another space
in the wrong place. Like this:
="T:\REPORTS\Affordable Housing Contracts " &
Format(Date(),"mm-dd-yy") & ".xls"

Yes, TransferSpreadsheet is the way to go, I'd say.
 
C

cjaaron

WOW HOOO! THANKS!!!!

cjaaron

Steve Schapel said:
Cjaaron,

You'll need to do it in the format I suggested. Your example is missing
the = and missing some "s and missing some spoaces and has another space
in the wrong place. Like this:
="T:\REPORTS\Affordable Housing Contracts " &
Format(Date(),"mm-dd-yy") & ".xls"

Yes, TransferSpreadsheet is the way to go, I'd say.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top