Exporting Multiple Queries from Access into Excel

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

Is this possible? It may sound like a daft question, but I
am exporting three queries from Access into Excel... at
present each is exported to a seperate excel spreadsheet.
Is it possible to export them all to three seperate
worksheets within the same spreadsheet. I don't want to go
down the route of union queries and exporting the data en
masse to a single sheet, I need to export them seperately.

Any advice appreciated :)
 
Hi Rob,

It's possible but as far as I know undocumented. Use
DoCmd.TransferSpreadsheet or the TransferSpreadsheet macro action, and
include the sheet name you want as the "Range" argument, e.g.

Docmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "MyQuery1", _
"D:Folder\File.xls", True, "MyQuery1"

Then repeat with the same filename but the other queries and sheet
names.
 
Thanks very much John, help much appreciated :)
-----Original Message-----
Hi Rob,

It's possible but as far as I know undocumented. Use
DoCmd.TransferSpreadsheet or the TransferSpreadsheet macro action, and
include the sheet name you want as the "Range" argument, e.g.

Docmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "MyQuery1", _
"D:Folder\File.xls", True, "MyQuery1"

Then repeat with the same filename but the other queries and sheet
names.


Is this possible? It may sound like a daft question, but I
am exporting three queries from Access into Excel... at
present each is exported to a seperate excel spreadsheet.
Is it possible to export them all to three seperate
worksheets within the same spreadsheet. I don't want to go
down the route of union queries and exporting the data en
masse to a single sheet, I need to export them seperately.

Any advice appreciated :)

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Back
Top