Sales Macro:
ImportExportSpreadsheet (Import, Excel Workbook,Sales)
OpenQuery (2013 Sales Make Table Query)
OpenQuery (Sept Sales Append Table Query)
OpenVisualBasicModule (Module2, ExportToExcel)
MessageBox (Macro Complete)
StopAllMacros
Is that what you need? I've tried various suggestions to export the file with the date at the end. They all work, but they all continue on without executing the module. The module does open in VB when the macro gets to that point, but I have to click on the Run to manually run the module!
Here is one of the modules I've tried:
____________
Private Sub ExportToExcel()
Const FileNameBase As String = "c:\users\me\my documents\Sales [CurrentDate].xlsx"
Dim strFileName As String
strFileName = Replace(FileNameBase, "[CurrentDate]", Format$(Date(), "yyyymmdd"))
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Sales
Compilation Table", strFileName, True
End Sub
__________
It works fine, but wont run in the macro, only opens up, and the macro continues on.