I have this short procedure in Excel which should use DoCmd to import a spreadsheet to a new table.
Code: Select all
'Tools- References Microsoft Access 11.0 Object Library
Sub UsingAccess()
Dim ac As Access.Application
Application.ScreenUpdating = False
Set ac = New Access.Application
ac.OpenCurrentDatabase "C:\Documents and Settings\A3train\My Documents\AndyDB.mdb"
ac.DoCmd.TransferSpreadsheet acImport, 8, "tblEmployees", _
"C:\Documents and Settings\A3train\My Documents\Employees", True, ""
ac.Quit
Set ac = Nothing
Application.ScreenUpdating = True
End Sub
I think I'm missing something straight-forward? Any idea?