Output Query Results To Excel

  • Thread starter Thread starter Matt
  • Start date Start date
M

Matt

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!
 
Check out the CreateObject function in help. This will open an excel
worksheet. Then you could design a loop to go thru your data from the query
and paste it into the cells on the worksheet. That way, the user will have
the option of saving or discarding the sheet.

Damon
 
Back
Top