Transfertext with date in file name.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to transfer a query in a macro to a text file. I would like the
file name to include the current date (i.e. File_Name_mmddyyyy). How can I
do this in my macro?
 
Brian,

In the File Name argument of the TransferText action in your macro, put
the equivalent of...
="C:\YourFolder\FileName_" & Format(Date(),"mmddyyyy") & ".txt"
 
I tried this outputting to excel and I get the following error, any
suggestions?

-The file may be open. If so close...
-If you are using a template, check to make sure the template exits.
-If the file isn't open, check to to make sure that you have enough free
disk space.
-Make sure that the file exists on the path specified.

The file is not open, there is no template being used, free space??? the
file is not that large, 1000k when I run it without the date stamp.

I am outputting to the following location in excel format:

"c:\temp\All Piece Parts" & Format(Date(),"mmddyy") & ".xls"
 
Did you include the = sign at the beginning of your expression? Do just as
Steve posted.
 
Back
Top