Hello,
I'm using the Filedialog to select an Excel file which has to be imported in my Access database. After selecting the file, the path will appear in a listbox.
Now I'm using the Transferspreadsheet function to import this spreadsheet but everytime I get the error : Object Required. I hope someone can help me with this.
My code for importing the file is as follow:
I'm using the Filedialog to select an Excel file which has to be imported in my Access database. After selecting the file, the path will appear in a listbox.
Now I'm using the Transferspreadsheet function to import this spreadsheet but everytime I get the error : Object Required. I hope someone can help me with this.
My code for importing the file is as follow:
Code:
'------------------------------------------------------------
' Import_BOM
'
'------------------------------------------------------------
Function Import_BOM()
On Error GoTo Import_BOM_Err
Dim db As DAO.Database
Dim rs As DAO.Recordset
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel97, "BOM", List20.Value, True, ""
Beep
MsgBox "Ready", vbOKOnly, ""
Import_BOM_Exit:
Exit Function
Import_BOM_Err:
MsgBox Error$
Resume Import_BOM_Exit
End Function