DoCmd.TransferSpreadsheet
Hello,
I am trying to use the VB TransferSpreadsheet method with MS Access, and I can't seem to get it right. I'm following all of the instructions from the Help menu, in Access. I am writing the VB code to run off a cmd button on a form. Here is my code so far:
Private Sub cmdImportTestData_Click()
DoCmd.TransferSpreadsheet acImport, 5, "TestTable1", "C:\TestData\ImportTestData1.xls", False
End Sub
Shouldn't this import data from the named spreadsheet to the TestTable1 table? I've double checked all of the syntax/names, the version of Excel, data type compatibilities, etc.
When I click on my cmdImportTestData button, nothing happens. I am new to VB, so I might be overlooking the obvious. If anyone has any insight, it would be greatly appreciated.
Thanks!
-- Carl