I have upgraded to Access2013 from 2003 and I have an application that I also upgraded to accdb. Because of a blackout yesterday, my application got corrupted and became unusable. So I opened a backup two weeks old, and when I tried to re-enter the lost data, I was faced with another problem. I use the following code to import a range in an Excel file with one sheet:
'setting variables to get the file path from table TblLuFilePath
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"
the code is freezing at the line in red and giving a run-time error 13, type mismatch
Any suggestions please ???
George