Reputation:
I have a table in Access 2007 with 11,000 rows and about 20 columns. I want to create a form button that exports the table to an Excel sheet. The code need to be VBA.
Any Ideas?
Upvotes: 1
Views: 580
Reputation: 15414
Here's an example.
DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel8, _
"myQuery", _
"C:\myDir\myFile.xls", _
True
You probably need to make sure that your destination is clear of the output filer (myFile.xls).
Upvotes: 3