Link to home
Start Free TrialLog in
Avatar of dougf1r
dougf1r

asked on

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"
    Me.ImportSurveyP.SetFocus
    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?
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dougf1r
dougf1r

ASKER

Worked great. Thanks!