I would like to generate the SQL text for data to export to an excel workbook. Further, I would like the workbook to have no saved location - just a new workbook (the default "book1", "book2"...). Lastly, the format of the data (pivot table, datasheet..) should also be optional.
I know access must be capable of this, because pushing the "Export to excel" button does exactly what I'm looking for, with any active query or table. Is there any way to harness the automation of the "Export to Excel" button through VB?
Everywhere I look seems only to have ways to export an existing query to an existing workbook.