savint to a file with seperate worksheets

Swifey

Active Member
Joined
Jan 16, 2003
Messages
421
I current output 4 queries to a separate file - Is it possible to save the 4 queries into one file? For example: One work file which contains a separate worksheet for every query.

Regards
Swifey
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hullo. This is certainly possible. One assumes that you are doing this through code. In the section for each query that gives it a destination, make sure that you are referencing the correct Sheet name.

HTH (y)

P
 
Upvote 0
Thank you for your response
Do I define the sheetname with a ! as follows?

DoCmd.OutputTo acQuery, "Qry 1 ", "MicrosoftExcelBiff8(*.xls)", "C:\My Documents\Customer\file!sheetname1.xls", False, "", 0

DoCmd.OutputTo acQuery, "Qry 2 ", "MicrosoftExcelBiff8(*.xls)", "C:\My Documents\Customer\file!sheetname2.xls", False, "", 0

Swifey
 
Upvote 0
I have tried the subsequent code to save 2 queries to one file with a spreadsheet for every query. My output is still saved to seperate files. Can you please highlight were I am going wrong.

DoCmd.OutputTo acQuery, "Qry 1 ", "MicrosoftExcelBiff8(*.xls)", "C:\My Documents\Customer\filename1!sheetnameQry1.xls", False, "", 0
DoCmd.OutputTo acQuery, "Qry 2 ", "MicrosoftExcelBiff8(*.xls)", "C:\My Documents\Customer\filename1!sheetnameQry2.xls", False, "", 0


Regards
Lynda
 
Upvote 0

Forum statistics

Threads
1,221,543
Messages
6,160,422
Members
451,644
Latest member
hglymph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top