Solved

MS Access export multiple queries to separate worksheets in Excel workbook

Posted on 2014-03-06
2
5,496 Views
Last Modified: 2014-03-06
I am currently using docmd.output to and exporting various queries in to separate Excel workbooks. Ideally I would like to export these queries to separate worksheets within one workbook and name the worksheets with the same name as the query.

This is what I do currently.

DoCmd.OutputTo acOutputQuery, "Bens CC", "Excel97-Excel2003Workbook(*.xls)", "z:\mi\BensCC.xls", False, "", , acExportQualityScreen
    DoCmd.OutputTo acOutputQuery, "Cab CC", "Excel97-Excel2003Workbook(*.xls)", "Z:\MI\CABCC.XLS", False, "", , acExportQualityScreen

Thanks for any advice
0
Comment
Question by:iainmacleod
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39909301
Hi,


pls try

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Bens CC",  _
"z:\mi\YourFile.xls", True, "Bens CC"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Cab CC",  _
"z:\mi\YourFile.xls", True, "Cab CC"

Open in new window

Regards
0
 

Author Closing Comment

by:iainmacleod
ID: 39909372
Hah, easy when you know how....!  Thanks very much..
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question