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

Exporting results from access to Excel in VBA

Status
Not open for further replies.

phillysri

Programmer
Joined
Dec 5, 2005
Messages
4
Location
US
hi

I am trying to export the result from a query into an excel . Could you tell me how to do this ..

thanks
 
Have a look at the DoCmd.TransferSpreadsheet method.

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 lot PHV I have tried this statement but it is giving me an error for the table name says microsoft JET could not find this object name

Where do we need to create this table ...in access or VBA

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "table1", "C:\Documents and Settings\TaduriS\My Documents\File.xls", True


thanks
 
Replace table1 with the name of the query you want to export.

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

I have created a variable with the the query in it and used that query to export but still it is giving an error saying object or path not found.

what path we need to give for this ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top