Output to excel or text with current date



I have a macro set up to "Output To" the results of a
query to Excel. I have another set up to "Transfer Text"
from a table to a text file. Is there a way to add the
current date to the name of these output files? I tried
using & Date() in my Output File mapping; e.g.,
C:\MyDocuments\'File Name' &Date() The result was
literal. Any suggestions?

Ken Snell

Yes. Use something like this for the filename argument:

="C:\FolderName\FileName" & Format(Date(), "mm-dd-yyyy") & ".xls"

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