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

Export an ADO recordset to Excel? 1

Status
Not open for further replies.

codemech

Programmer
Feb 8, 2004
34
US
I want to export and ado recordset to excel without having to use code to create the excel spreadsheet and loop through the recordset to populate the cells.

I want to use something like the docmd.outputto command. Has anyone been able to get this to work?

Codemech
 
you can use DoCmd.OutputTo but not with an ADO recordset.

create a generic QueryDef (if your query isn't fixed), in your code, you can change the SQL tied to the QueryDef (if you need dynamic SQL), and then use DoCmd.OutputTo on the QueryDef.
 
Will this work with an .adp file? I thought the QueryDef object was used with .mdb files?

Codemech
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top