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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Niznik
    New Member
    • Aug 2010
    • 1

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

    by using a mcaro, I need to transfer an access table into Excel and insert today's date in the filename.
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    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.

    Code:
        DoCmd.OutputTo acOutputTable, "TableName", "Excel97-Excel2003Workbook(*.xls)", "C:\" & Format(Now(), "ddmmyyyy") & ".xls", False, "", 0, acExportQualityPrint

    Comment

    Working...