Saturday, April 3, 2010

VBScript - How Can I Save a Table in an Access Database as a Spreadsheet?

VBScript - How Can I Save a Table in an Access Database as a Spreadsheet?

Const acExport = 1
Const acSpreadsheetTypeExcel9 = 8

Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\Scripts\Test.mdb"

objAccess.DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, _
"Employees", "C:\Scripts\Employees.xls", True

[Via]