I have an Access database with ~30 tables.
How can I export all 30 tables into separate sheets in an Excel workbook?
I'm hoping to find some VBA/VBS code which I can run from within Access to accomplish this task.
Any ideas?
On the External Data tab, in the Export group, click Excel. In the Export - Excel Spreadsheet dialog box, review the suggested file name for the Excel workbook (Access uses the name of the source object). If you want, you can modify the file name. In the File Format box, select the file format that you want.
You should be able to do something like this:
Dim tbl as Tabledef
For Each tbl in Currentdb.TableDefs
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, tbl.name, "PathName.xls", True, tbl.name
Next
The second tbl.name
is the worksheet name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With