First question on Stackoverflow, have been using the site as a viewer for a long time.
I need to export a query from Access 2010 into an existing Excel 2010 Workbook which can be either .xlsm or .xlsb (since macros work in both). I set it up the following way:
- User clicks a button in the Excel workbook to refresh a tab
--> this runs VBA in Excel that calls a Macro in Access to run ---> the macro in Access merely calls an existing query in Access to run and export the results back to the initial Excel Workbook.
Access Macro Code:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "Data_SlotView", "M:\Merch. Strategy\Merch Forecasting\Automotive Division\File Sharing\Automotive Deal-Page-Slot View\Deal-Page-Slot-View.xlsb"
My code works if my Excel file was .xlsx but apparently Access 2010 does not allow exporting to Excel files with macros so I have to use some sort of workaround method.
"apparently Access 2010 does not allow exporting to Excel files with macros"? Did you read that somewhere or is it a guess?