Exporting .xls file with file name changeable

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

Guest

I need to export a file. That's the easy part.
The difficult part is I need the file to be named YYYY-MM based on the data
range someone pulls. How do I do this?
Furthermore, I need the file to place the data on a certain tab in a certain
cell. How do I do this?
If possible I would like to build a .xls template and have it open it and
then save it as the YYYY-MM filename.

Call it your brain challenge of the day. Thanks.
 
You can use docmd.transferspreadsheet to export to excel and pass it a file
name constructed on entered date using format function:

strFileName="C:\Data" & Format(dateVar,"YYYY-MM") & ".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

Back
Top