I am wanting to create a File Selector and import the selected file into access table. I have this syntax, but it does not like my TransferSpreadsheet syntax. What do I need to alter in order for the selected spreadsheet to be imported into a table named "Test"? I also have the filter set to *.xls* as it could be a .xls or a .xlsx
Code:
Set f = Application.FileDialog(3)
With f
.AllowMultiSelect = False
.Title = "Please Select the Excel File To Import"
.Filters.Add "Excel Files", "*.xls*"
If .Show = True Then
For i = 1 To f.SElectedItems.Count
selectedfile = f.SElectedItems(i)
DoCmd.TransferSpreadsheet(acImport, , "Test", selectedfile, True)
Next
Else
MsgBox "You clicked Cancel in the file dialog box."
End If
End With