How to set all cells background color?

Jun 7, 2012 at 1:04 AM

I created 1-sheet workbook with Excel, selected all cells and then fill them with white color. Finally, the file size is only 14KB.

Then I created another 1-sheet workbook with NPOI, and then fill all rows with white.  The file size is 1.4MB. 

        For i = 0 To 65535
            row = sht.CreateRow(i)
            row.RowStyle = cellstyle


Does anyone know how to set BIFF8 cells color without creating empty rows?


Jun 29, 2012 at 7:37 AM

I figured out how Excel set the worksheet color! Suggest to update it into next release.

1) Add one XF (e0h) record into "Workbook global records"

2) Add one COLINFO (7Dh) record into "Sheet x substream records". This COLINFO record contains index of XF style record in step 1.

Jul 26, 2012 at 11:03 PM

It looks what you are talking about is ColumnStyle instead of RowStyle. I'll consider to support this in future version.