Skip to content

Instantly share code, notes, and snippets.

View Mikuana's full-sized avatar

Christopher Boyd Mikuana

View GitHub Profile
@Mikuana
Mikuana / ExportDatabase.vba
Created December 22, 2015 05:20
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