Skip to content

Instantly share code, notes, and snippets.

@Mikuana
Created December 22, 2015 05:20
Show Gist options
  • Save Mikuana/c5bd87716eff8f32ccd0 to your computer and use it in GitHub Desktop.
Save Mikuana/c5bd87716eff8f32ccd0 to your computer and use it in GitHub Desktop.
Export all tables in a Microsoft Access database to text
Option Compare Database
Public Sub ExportAll()
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllTables
If Left(obj.Name, 4) <> "MSys" Then
DoCmd.TransferText acExportDelim, , obj.Name, obj.Name & ".csv", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, obj.Name, obj.Name & ".xls", True
End If
Next obj
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment