To export it and save it in a specific directory, you can also do:
DoCmd.OutputTo acOutputForm, "Name", acFormatXLS, "c:\Documents and Settings\My Documents\Name.xls", True
This should open Excel with the table displayed. After that, I'm not sure if you switch to an Excel macro to do the rest...
Here's a start on exporting a table to excel:
Private Sub Command0_Click()
DoCmd.OutputTo acOutputTable, "NameOfTable", acFormatXLS, "NameOfTable2.xls", True
End Sub
I found it in Visual Basic Help, did a search for "OutputTo Method"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.