macro to send query results to excel

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
 
B

Beejels

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!
 

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

Top