Send data to Excel using "OutputTo"

  • Thread starter Thread starter Liz Hansen
  • Start date Start date
L

Liz Hansen

Hello,

I'm have several queries that I output to Excel. Then in Excel I move them
all to the same workbook. Is there a way to send more than one query to the
same workbook, just adding a worksheet per query

I'm using the following code at this time:
DoCmd.OutputTo acOutputQuery, "qry1", acFormatXLS, , True
DoCmd.OutputTo acOutputQuery, "qry2", acFormatXLS, , True
and so on

Thanks,

Liz
 
Use TransferSpreadsheet for the second, third, etc. queries. It adds a
worksheet to an existing file.
 
Hi Ken,

I neglected to mention that my queries are CrossTab queries. After reading
up on TransferSpreadsheet it only looks like this will work for Select
Queries only.

Any other way to work around this?

Thanks for your help.

Liz
 
I just tested using TransferSpreadsheet to export a crosstab query. Worked
fine.
 
You are absolutely right. I must have done something wrong when I tried it.

Thanks again for all your help.

Liz
 
Back
Top