I found this post that runs some code that does exactly what I need, here are the steps.
- In Access under the 'Database Tools' option click 'Visual Basic'
- In the new window click 'Run' then 'Run Macro'
- Type a name in like "AccessMacro" then click 'Create'
- In the new screen that appears copy and paste the code below replacing anything that was originally in the new window
Sub AccessMacro()
Dim tbl As TableDefEnd Sub
For Each tbl In CurrentDb.TableDefs
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, tbl.Name, "C:\Users\Josh\Desktop\NexGen\Test2.xls", True, tbl.Name
Next
You will need to adjust the area that is in bold above to the proper path on your computer when the file will be exported to.
Next click Run, then run macro and that's it!
If you hit an error that says 'User Defined Type Not Defined' simply do the following:
Tools > Reference... > (Check) Microsoft DAO 3.6 Object Library > OK
Below is the link to the original site that I found this information:
http://stackoverflow.com/questions/4036772/how-to-export-all-tables-from-an-access-database-into-excel-a-sheet-for-each-t
No comments:
Post a Comment