I noticed when I run Range.SetOutlineBorder(), the MaxColumn is increased from 44 to 16383 and the file size is enlarged by 100%.
var workbook = new Workbook(@".\test.xlsx"); // max column in the original file is AT, file size 53KB
var ws = workbook.Worksheets;
var row = ws.Cells.CreateRange(“21:21”);
Console.WriteLine(ws.Cells.MaxColumn); // print 44
row.SetOutlineBorder(BorderType.BottomBorder, CellBorderType.None, Color.Black);
Console.WriteLine(ws.Cells.MaxColumn); // print 16383
workbook.Save(@".\output.xlsx"); // max column in the output is changed to XFD, file size 97KB
This causes a problem because we do not intend to change the MaxColumn value and we rely on it for some rendering/printing (where we couldn’t use MaxDataColumn), and the file size increase is also a concern.
I’ve attached the test file and the output for your reference. Could you please help me check?
test.zip (98.0 KB)