macro with new file name

G

Guest

I posted the following question and was given the answer below, new question:
Can it be saved as an excel spreadsheet or access table without it being a
txt file?

Is there a way to write a macro that will run a query and then save it to a
server file and name it the date it was ran? Thanks,

You can output the data returned by a query as a text file, using a
TransferText action in your macro. Is that what you want? If so, you
can enter the equvalent of the following in the File Name argument of
the macro...
="D:\YourFolder\" & Format(Date(),"yyyymmdd") & ".txt"
 
K

Ken Snell [MVP]

TransferSpreadsheet is the macro action to export a table or query into an
EXCEL workbook.
 

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