I have an .xlsx file and I have changed the file extension to .xls and I am trying to read it using Gembox library. The problem is that when I am trying to read the file using GemboxExcel.LoadXls(fileName);
method I get the following error:
Exception message: Analysis failed: Reading error: file is not a valid OLE2 Compound File. Exception stack trace: System.Exception: Analysis failed: Reading error: file is not a valid OLE2 Compound File. ---> GemBox.CompoundFileException: Reading error: file is not a valid OLE2 Compound File. at GemBox.ReadData.ReadHeader(BinaryReader br, ArrayList& masterAllocationTable) at GemBox.ReadData..ctor(Ole2CompoundFile ole2File, Stream inputStream)
at GemBox.Ole2CompoundFile.Load(Stream stream, Boolean loadOnDemand)
at GemBox.Spreadsheet.ExcelFile.ReadStreamHelper(ExcelFile excelFile, Stream inputStream, Boolean readSummaryStreams, Byte[]& ss, Byte[]& dss, Boolean readMacros, Byte[]& ctls, Byte[]& compObj, Ole2Storage& mStorage, String fileName) at GemBox.Spreadsheet.ExcelFile.LoadXls(String fileName, XlsOptions xlsOptions
The problem is that if that if I save the file from Excel (Microsoft Excel -> Save As -> .xls file) and then I open the file in my program and use the GemboxExcel.LoadXls(fileName);
method, it works correctly.
I have installed the Microsoft Office Compatibility Pack on my machine but it does not work.
Did someone came across this issue?