I have the following problem :
when I try to load an XML based Excel file (.xlsx) and even if I set the LoadOption
to XlsxDefault
the program throws the error Reading error: file is not a valid OLE2 Compound File."
.
it don't throw any exceptions if I try to load the .XLS-exported version of the workbook, seems like ExcelFile.Load
method cannot open xml based excel files.
I Tried to replace the path of my spreadsheet with one .xlsx file downloaded on The Gembox example page but it didn't change anything. currently my only way to open a Excel Workbook is to load a .xls version of the file.
EDIT : I can open the .xlsx files with excel without any problems
EDIT2: I Wasn't able to reproduce the problem in another solution so I Think that another part of my soft is responsible of my problem
That is a handled exception, GemBox.Spreadsheet internally does throw and handle that exception in order to determine if it's an encrypted XLSX or not.
Two things are required in order for you to receive that error in Visual Studio.
In order to resolve this you can either enable the "Enable Just My Code" setting or disable the "<All Common Language Runtime Exceptions not in this list>" setting.
As an FYI, from MSDN:
If you check a given exception, debugger execution will break wherever the exception is thrown, regardless of whether it is handled or unhandled. At this point the exception is called a first chance exception.