'actually I have a macro that exports multiple querys or table into many excel spreadsheet with multiple worksheets.
'but this is just to test the Excel Macro to work on the exported files.
'is there any way to create just one RunCode that will work with for all of these files in a ACCESS Macro?
What this Excel Macro does is split the worksheets based on the first column starting in Cell A2 into tabs. if there is anyway to do this in Access than relying on Excel Macro that would be greatly appreciated.
'but this is just to test the Excel Macro to work on the exported files.
'is there any way to create just one RunCode that will work with for all of these files in a ACCESS Macro?
Code:
Function testfunction()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Customers", "C:\Users\Juan\Desktop\test\Macrofolder\combine.xlsx", True
Dim XL As Object
Set XL = CreateObject("Excel.Application")
'XL.Workbooks.Open "C:\Users\Juan\Desktop\test\Macrofolder\combine.xlsx"
XL.Workbooks.Open "C:\Users\Juan\Documents\acom split.xlsm"
'what do I need to type in order for this macro to work on the transferspreadsheets? because it runs on itself.
XL.Run "acom split.xlsm!acomsplit"
End Function
Comment