export to excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If I have a make table query and have created a macro to:
Open the query and then transfer the spreadsheet, is there a way to have the
macro to also open the excel file and then close access?
 
If I have a make table query and have created a macro to:
Open the query and then transfer the spreadsheet, is there a way to have the
macro to also open the excel file and then close access?

Using code you can do it like this:
(Watch for line wrap on the longer lines.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel97,
"YourQueryName", "C:\PathToSpreadsheet\SpreadsheetName.xls", True

Application.FollowHyperlink "C:\PathToSpreadsheet\SpreadsheetName.xls"

DoCmd.Quit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top