K
Ken Snell
Not sure why you're getting this problem. However, change this code line:
Dim objExcel As Excel.Application, objWorkbook As Excel.Workbook
to this:
Dim objExcel As Object, objWorkbook As Object
Let's see if that clears up that problem.
Also, because you're using an .xlsx EXCEL file, you need to change this
line:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames, colWorksheets(lngCount)
& "$"
to this:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, _
strTable, strPathFile, blnHasFieldNames, colWorksheets(lngCount)
& "$"
--
Ken Snell
http://www.accessmvp.com/KDSnell/
Dim objExcel As Excel.Application, objWorkbook As Excel.Workbook
to this:
Dim objExcel As Object, objWorkbook As Object
Let's see if that clears up that problem.
Also, because you're using an .xlsx EXCEL file, you need to change this
line:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
strTable, strPathFile, blnHasFieldNames, colWorksheets(lngCount)
& "$"
to this:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, _
strTable, strPathFile, blnHasFieldNames, colWorksheets(lngCount)
& "$"
--
Ken Snell
http://www.accessmvp.com/KDSnell/