Posted 15 October 2021, 8:14 am EST
This was introduced in .520: the following line of code crashes because the value is NULL, see attached sample:
sheet.GetCell(1, 1).SetValue(null, style);
This is caused by this code in “XLCell.SetValue”:
public void SetValue(object value, XLStyle style)
{
if (style != null && value.ToString().StartsWith("'"))
{
...
}
Workaround: use this code:
sheet.GetCell(1, 1).Value = null;
sheet.GetCell(1, 1).Style = style;
Best regards
Wolfgang