Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXPORT QUERIES INTO EXCEL WORKBOOK AS WORKSHEETS 1

Status
Not open for further replies.

netrusher

Technical User
Feb 13, 2005
952
US
I have six queries that I need to export into excel format. No problem. What I would really like to do from a macro or with code is export all six queries into one Excel Workbook with each query being it own worksheet by query name. Is this possible?
 
This will transfer the contents of the two queries to two worksheets in the one workbook.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryYourQueryName1", "PathName.xls", True, "WorkSheetName1"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qryYourQueryName2", "PathName.xls", True, "WorkSheetName2"

David
 
David,

After I run this how can I then have the Excel File Open up?
 
You may try this:
DoEvents
Application.FollowHyperlink "PathName.xls"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top