macro to send query results to excel

  • Thread starter Thread starter macro novice
  • Start date Start date
M

macro novice

I'm a macro novice. Is it possible to create a macro that
opens Access 2000, runs a query, sends the results to
Excel, and then sends the Excel file to a mail recipient?

thx
 
Try this;

Create a form, add a button. View the button properties. In the "On Click"
property, put this text into the macro.

Private Sub Command14_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8,
"Yourqueryname", "c:\myfilename.xls"

End Sub

Good luck!
 
Back
Top