Transfer text delimited with date in file name using a macro

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

Guest

I am stuck (who isn't when they post?) I have created a 4 step macro and the
3rd step, using transfer text, export delimited, with a named specification,
to export a text file using "C:\batchfile" &_Format(Now(),"yyyymmddhhmm") &
".txt", I get that '"C:\' is not a valid path.

If I remove quotes,C:\batchfile &_Format(Now(),"yyyymmddhhmm") & .txt then
(Obviously) I get a file named literally without the actual date stamp.

If I move the quotes to past the C:\ , C:\"batchfile"
&_Format(Now(),"yyyymmddhhmm") & ".txt" then I get "Cannot update. Database
or object is read only"

Any suggestions would be great,

Thanks.

Angie
 
try the following in the macro's FileName action argument, *exactly* as you
see it here:

="C:\batchfile_" & Format(Now(),"yyyymmddhhnn") & ".txt"

the above goes all on one line in the macro argument, of course.

hth
 
Thank you so much, I had tried it with the "=" but I guess with a quote
somewhere in the wrong place..

No longer stuck!
 
you're welcome :)
btw, i suspect the problem is that you put the underscore ( _ ) *outside* of
the quotes

"C:\batchfile" &_Format(Now(),"yyyymmddhhmm")

instead of inside the quotes

"C:\batchfile_" & Format(Now(),"yyyymmddhhnn")
 
Back
Top