Trouble with TransferSpreadsheet

kevinh2320

Board Regular
Joined
May 13, 2016
Messages
61
I'm importing an .xls file into my MSAccess DB from a known trusted source but, get a Run-time error "3170" Could not file installlable ISAM. When I open the .xls file directly I'm prompted with the following message:
1587673953515.png

If I click "Yes" the file opens fine. Is there a way to get my VBA code to answer this prompt so the file will import? The code I'm using is shown below:

Private Sub importDayUseData_Click()

Dim varRetVal As Variant

'This code imports Registration data
If MsgBox("This action will load all Day Use registration data. Do you want to continue?", _
vbYesNo + vbQuestion) = vbYes Then
DoCmd.SetWarnings False
DoCmd.Close acForm, "f_commRec_day_use"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel08, "t_website_registrants", "F:\commrec_reminder_ltr\Data\CommRecDayUseWebData\commrec_export.xls", False
varRetVal = ClearClipboard
vForm = "f_commRec_day_use"
DoCmd.OpenForm vForm, acNormal

Else

Exit Sub

End If

MsgBox ("Download Complete!")

End Sub
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,221,537
Messages
6,160,405
Members
451,644
Latest member
hglymph

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top