When trying to open certain workbook I am getting the exception "An item with the same key has already been added." with the StackTrace
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Spire.Xls.Core.Spreadsheet.XmlReaders.Shapes.ShapeParser.SplitStyle(String styleValue)...(the rest is decompiled nonsense methods)
even after catching this exception, what i am guessing is a background thread throws an exception that goes uncaught and kills the application. "An unhandled exception of type 'System.NullReferenceException' occurred in Spire.XLS.dll" no stack trace at that point.
The code i am using is the simple
Workbook book = new Workbook();
book.LoadFromFile(attachment);
book.SaveToFile(pdfAttachment, FileFormat.PDF);
It is breaking on LoadFromFile...this works for most workbooks i have tried, but is failing on this workbook and a few others, this workbook can be opened with another API we are using and opens without exception in Excel. The book contains 5 pages 1 has a table with data in it (actually made up of 2 ranges but the table spans them), 1 page is just simple data, 1 page is a pivot table based on the data in the second sheet, 1 page is just data that is used as variables during execution, and the last page is just some simple data used for information. Any idea what would cause this issue when loading the book and why there is a following unhandled exception that isn't caught by the surrounding try{}catch{} block and kills the program?