diff --git a/ClosedXML/ClosedXML/ClosedXML/Excel/Cells/XLCell.cs b/ClosedXML/ClosedXML/ClosedXML/Excel/Cells/XLCell.cs index e8ca9e0..77f1ec7 100644 --- a/ClosedXML/ClosedXML/ClosedXML/Excel/Cells/XLCell.cs +++ b/ClosedXML/ClosedXML/ClosedXML/Excel/Cells/XLCell.cs @@ -445,6 +445,8 @@ if (!SetRichText(value)) SetValue(value); + + if (_cellValue.Length > 32767) throw new ArgumentException("Cells can only hold 32,767 characters."); } } @@ -1396,7 +1398,7 @@ Style.Alignment.WrapText = true; } } - + if (val.Length > 32767) throw new ArgumentException("Cells can only hold 32,767 characters."); _cellValue = val; }