By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,695 Members | 1,473 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,695 IT Pros & Developers. It's quick & easy.

How to transfer an accdb table into Excel and insert todays date in the filename

P: 1
by using a mcaro, I need to transfer an access table into Excel and insert today's date in the filename.
Aug 26 '10 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 14,534
I don't know of any way to dynamically name a file in macros. However, you can do it very simply using the following code.

Expand|Select|Wrap|Line Numbers
  1.     DoCmd.OutputTo acOutputTable, "TableName", "Excel97-Excel2003Workbook(*.xls)", "C:\" & Format(Now(), "ddmmyyyy") & ".xls", False, "", 0, acExportQualityPrint
Aug 28 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.