I have the following code to import an Excel sheet into my Access app. I wrote the code in Access 2003 a couple of years ago and now using Access 2013. It worked fine with both versions till today.
It is giving me a "Type Mismatch" error and hangs on the line in red. Any help??
"
Dim d As Database
Dim r As Recordset
Dim Path As Field
Set d = CurrentDb()
Set r = d.OpenRecordset("TblLuFilePath")
Set Path = r.Fields("FilePath")
'import range named ToAccess from the Excel file defined in the previous code
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"TblCardsTrans", Path, True, "ToAccess"
"
I have created a table (TblLuFilePath) where each user can specify his Excel file name and its path
btw, i checked and both the path and file name are correct
thanks
george
It is giving me a "Type Mismatch" error and hangs on the line in red. Any help??
"
Dim d As Database
Dim r As Recordset
Dim Path As Field
Set d = CurrentDb()
Set r = d.OpenRecordset("TblLuFilePath")
Set Path = r.Fields("FilePath")
'import range named ToAccess from the Excel file defined in the previous code
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
"TblCardsTrans", Path, True, "ToAccess"
"
I have created a table (TblLuFilePath) where each user can specify his Excel file name and its path
btw, i checked and both the path and file name are correct
thanks
george
