Reputation: 7163
I can currently upload an excel file to an uploads directory:
FileUploadExcel.SaveAs(Server.MapPath("~/Uploads/ExcelImport.xls"))
But when I try to retrieve it to open it, it reports that it can't find it:
xlWorkBook = xlApp.Workbooks.Open("~/Uploads/ExcelImport.xlsx")
Error message:
'~/Uploads/ExcelImport.xlsx' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted.
Anyone know what might be the problem or seen this before?
Upvotes: 0
Views: 163
Reputation: 45096
Try
xlWorkBook = xlApp.Workbooks.Open(Server.MapPath("~/Uploads/ExcelImport.xls"))
Upvotes: 2