Transfer text delimited with date in file name using a macro

A

AngieSD

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
 
T

tina

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
 
A

AngieSD

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

No longer stuck!
 
T

tina

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")
 

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