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
'Note:create test.mdb in C:\Scripts\Test.mdb with one table(create one table) inside named as Employees and
'create newspreadsheet in C:\Scripts\Employees.xls
''run the script and finally you will see the employee table created in access in excelsheet
No comments:
Post a Comment