Issue with addCopy

Here is my code

It fails on the AddCopy method with an error “Value cannot be null. (Parameter ‘key’)”

Stack trace
at System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Collections.Generic.Dictionary2.FindValue(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value)
at GemBox.Spreadsheet.CellStyleCollection.(Style )
at GemBox.Spreadsheet.CellStyleCollection.(e , Boolean )
at .e(ExcelWorksheet , ExcelWorksheet )
at …ctor(ExcelWorksheet , ExcelWorksheet ,  )
at GemBox.Spreadsheet.ExcelRowCollection…ctor(ExcelWorksheet , ExcelRowCollection )
at GemBox.Spreadsheet.ExcelWorksheet…ctor(String , ExcelWorksheetCollection , ExcelWorksheet )
at GemBox.Spreadsheet.ExcelWorksheetCollection.(String , Int32 , ExcelWorksheet )

Version 49.0.1655

link to the test file

Hi Oleg,

Please try again with this NuGet package:

Install-Package GemBox.Spreadsheet -Version 49.0.1670-hotfix

Note that this is a hidden pre-released version, to install it you’ll need to run the above command on the NuGet Package Manager Console (Tools → NuGet Package Manager → Package Manager Console).

Does this solve your issue?


Hey Mario,
Works for me.
Thanks a lot!