VBA error when importing Excel 2010 file

I am receiving Run-time error '3170': Could not find installable ISAM when attempting to import an Excel 2010 file (.xlsx) into an Access 2010 database using this code:

Private Sub ImportSurveyP_Click()
If IsNull(Me.txtFileName) Or Len(Me.txtFileName & "") = 0 Then
    MsgBox "Please select the Excel file"
    Exit Sub
End If

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel14, "data_Flow", Me.txtFileName, True

End Sub

Open in new window

The error is with the TransferSpreadsheet line and I think it relates to the acSpreadsheetType.

I also tried acSpreadsheetType21Xml (as suggested elsewhere) in addition to acSpreadsheetType14 and this gives the same error.

Suggestions for what else I can try?
Who is Participating?
Rey Obrero (Capricorn1)Connect With a Mentor Commented:

DoCmd.TransferSpreadsheet acImport, 10, "data_Flow", Me.txtFileName, true
dougf1rAuthor Commented:
Worked great. Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.