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

Analyze with Excel

Status
Not open for further replies.

rnegde

Technical User
Jan 13, 2002
23
US
I have a command button that opens a select query. What I need is to have it do the whole Tools/Analyze with Excel thing. Is there any way to have that same button open the query, convert it to excel and save it? If it would also close excel and the query that would be cool too. Thanks for any info!!!
 
You can change the select query to a make table query. Have it create a table called tableName then after the query has run, have your code transfer the table using the transferSpreadsheet method.

' this should all be on one line ...

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, tableName, "c:target.xls", True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top