Export to Excel - Multiple Worksheets (1 Viewer)

alexfwalker81

Member
Local time
Today, 07:18
Joined
Feb 26, 2016
Messages
93
I have 4 crosstab queries which I can export successfully to .xlsx, using ExportWithFormatting in a macro. However, I'd really like to be able to write the first crosstab to a new workbook, then append the following 3 crosstab queries as subsequent worksheets within the workbook. Is that possible?
 

Isaac

Lifelong Learner
Local time
Today, 07:18
Joined
Mar 14, 2017
Messages
8,774
One way you can do this is to use Excel automation, combined with the CopyFromRecordset method.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:18
Joined
Oct 29, 2018
Messages
21,449
Hi. Maybe you could also try using the TransferSpreadsheet method.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 15:18
Joined
Jul 9, 2003
Messages
16,271
I answered a somewhat similar question recently:-


My example uses a query, not a crosstab query but it might give you some ideas.
 

Users who are viewing this thread

Top Bottom