Export multiple queries to multiple Sheets in Excel

G

Guest

I'm using the TransferSpreadsheet function in vba to export a query to an
Excel file.
I have 5 queries that I would like to export (via vba) to 5 separate Sheets
in a single Excel file. I want the User to be able to click a single button
on a form and have the 5 queries exported to the single Excel file. Anyone
have a sample code for this?
 
G

Guest

You can use the Range argument of the TransferSpreadsheet method to do this.
Although Help says it will fail, it will not. It does work:

DoCmd.TransferSpreadsheet acExport, 3, _
"Employees","C:\Lotus\Newemps.wk3", True, "MyWorksheetName"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top