Connecting Tech Pros Worldwide Help | Site Map

Output the results of a query to Excel

  #1  
Old February 27th, 2007, 02:25 PM
Matt
Guest
 
Posts: n/a
Hi All,

I am currently outputting the results of a query to an Excel Workbook
using the following line of code:


DoCmd.OutputTo acOutputQuery, queryName, acFormatXLS, , True


What this is doing is asking the user where to specify where the file
will be saved and then opens the file. What I would like to do is to
just open a new workbook without asking the user to specify the file
save. It would be like opening excel and pasting the results of the
query in ... if the user wants to save they can later.


As always, thanks in advance for any help!

  #2  
Old February 27th, 2007, 03:55 PM
DavidB
Guest
 
Posts: n/a

re: Output the results of a query to Excel


DoCmd.TransferSpreadsheet

On Feb 27, 9:16 am, "Matt" <mdw233...@yahoo.comwrote:
Quote:
Hi All,
>
I am currently outputting the results of a query to an Excel Workbook
using the following line of code:
>
DoCmd.OutputTo acOutputQuery, queryName, acFormatXLS, , True
>
What this is doing is asking the user where to specify where the file
will be saved and then opens the file. What I would like to do is to
just open a new workbook without asking the user to specify the file
save. It would be like opening excel and pasting the results of the
query in ... if the user wants to save they can later.
>
As always, thanks in advance for any help!

  #3  
Old February 28th, 2007, 07:55 PM
Matt
Guest
 
Posts: n/a

re: Output the results of a query to Excel


On Feb 27, 10:41 am, "DavidB" <j...@yahoo.comwrote:
Quote:
DoCmd.TransferSpreadsheet
>
On Feb 27, 9:16 am, "Matt" <mdw233...@yahoo.comwrote:
>
>
>
Quote:
Hi All,
>
Quote:
I am currently outputting the results of a query to an Excel Workbook
using the following line of code:
>
Quote:
DoCmd.OutputTo acOutputQuery, queryName, acFormatXLS, , True
>
Quote:
What this is doing is asking the user where to specify where the file
will be saved and then opens the file. What I would like to do is to
just open a new workbook without asking the user to specify the file
save. It would be like opening excel and pasting the results of the
query in ... if the user wants to save they can later.
>
Quote:
As always, thanks in advance for any help!- Hide quoted text -
>
- Show quoted text -
Thanks!!!

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: can't redirect to Excel Paul Lautman answers 18 July 20th, 2008 02:45 PM
Automation of queries 's results in Excel document Belgarath answers 4 April 5th, 2007 04:05 PM
Export to Excel, recordset is empty sometimes Jean answers 7 November 13th, 2005 07:43 AM
Export to Excel Matt answers 1 July 22nd, 2005 04:07 AM