UnysonElliot
New Member
- Joined
- Jul 21, 2014
- Messages
- 31
Hi All,
I'm trying to export a table with a date attached to the end of it. I've seen a ton of examples on Google already but I can't get any of them to work for me. Currently I have tried it through the macro tool and in a module and no success.
Here's what I have in the module:
For the module I have the code and a Macro setup to RunCode calling Elliot()
Public Function Elliot()
Dim Current_Date As String
Dim File_Name As String
Current_Date = Format(Now(), “yyyymmdd hhmmAMPM”)
File_Name = “T:\GLOBAL INDUSTRIAL\Global Invoice Report\Global Invoice Shipment Report.xlsx-” + Current_Date + “.xls”
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, “Global Invoice Shipment Report“, [File_Name]
End Function
When I run the Macro I get an error that says Compile error: Syntax Error. When I click okay the first line highlights in yellow.
When I try the Macro Builder using ExportWithFormatting
Object Type: Query
Object Name: Global Invoice Shipment Report
Output Format: Excel Workbook (*.xlsx)
Output File: T:\GLOBAL INDUSTRIAL\Global Invoice Report\Global Invoice Shipment Report&Format(Date(),"yymmdd")&.xlsx
Auto Start: No
Template File:
Encoding:
Output Quality: Print
This does not work either.
Any help would be greatly appreciated.
I'm trying to export a table with a date attached to the end of it. I've seen a ton of examples on Google already but I can't get any of them to work for me. Currently I have tried it through the macro tool and in a module and no success.
Here's what I have in the module:
For the module I have the code and a Macro setup to RunCode calling Elliot()
Public Function Elliot()
Dim Current_Date As String
Dim File_Name As String
Current_Date = Format(Now(), “yyyymmdd hhmmAMPM”)
File_Name = “T:\GLOBAL INDUSTRIAL\Global Invoice Report\Global Invoice Shipment Report.xlsx-” + Current_Date + “.xls”
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, “Global Invoice Shipment Report“, [File_Name]
End Function
When I run the Macro I get an error that says Compile error: Syntax Error. When I click okay the first line highlights in yellow.
When I try the Macro Builder using ExportWithFormatting
Object Type: Query
Object Name: Global Invoice Shipment Report
Output Format: Excel Workbook (*.xlsx)
Output File: T:\GLOBAL INDUSTRIAL\Global Invoice Report\Global Invoice Shipment Report&Format(Date(),"yymmdd")&.xlsx
Auto Start: No
Template File:
Encoding:
Output Quality: Print
This does not work either.
Any help would be greatly appreciated.