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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export several queries to Excel

Status
Not open for further replies.

ping99

Technical User
Mar 16, 2006
45
CA
Hi all,

I use this routine to export 2 queries to a single excel
worksheet but always overwrite in the sheet1 with a second
query below instead of having 2 sheets

Public Sub export()

DoCmd.OutputTo acOutputQuery, "qry - watchlistVP", acFormatXLS, "C:\temp\pme\pme_vb\watchlista.xls", 0

DoCmd.OutputTo acOutputQuery, "qry - watchlistVPMC", acFormatXLS, "C:\temp\pme\pme_vb\watchlista.xls", 0

End Sub

It means I want to have 2 sheets called qry - watchlistVP and qry - watchlistVPMC one after another.

Please assist to fix my routine or give some suggestions
how to solve this problem ?

TIA
 
Have you tried the DoCmd.TransferSpreadsheet method instead ?

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

Thanks a million PHV,

It works fine with your suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top