xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Open("C:\\Data_check\\Load Data Check_new_3.xlsx", 0, false, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", true, false, 0, false, 1, 0);
I am trying to open an excel workbook through the above code, however it throws an error that the file could not be found or is it moved, or removed. I can open the file if i type the path in windows explorer .
The screenshot of the error is shown:
I'm not sure what the problem is here.. I was able to open a similar file placed on my desktop but not this one.
System.IO.File.Exists("C:\\Data_check\\Load Data Check_new_3.xlsx")return true? So we can isolate this as an Excel issue rather than permissions etc?using (var fs = System.IO.File.Open("...", FileMode.Open, FileAccess.ReadWrite));see what exception that raises