Finding Cell background Color

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
billegge
Posts: 23
Joined: Fri Feb 08, 2008 8:34 pm

Finding Cell background Color

Post by billegge »

I am confused on the proper way to get the background color of a cell.

* The R and B seem to be reversed in the new excel format, its ok in the old 97-2003 format. (I am reading from Sheet.Cell[ACol, ARow].CellColorRGB). Meaning for example, if the color is yellow then in the old format this is $00FFFF but in the new format it is $FFFF00.

* I cannot tell if a cell has a black background. In the new format, CellColorRGB (of TCell) returns 0. In the old 97-2003 format, it is also basically 0 (see next comment for what I mean by "basically"). The cells that have no background color (are white) are also 0 - so I cannot distinguish between no background and black.

* In the old format, the CellColorRGB has an extra byte set to F, meaning this: F000000 where the RGB take up the first right 6 digits (in hex) and there is an extra F at the 7th position (fromthe right).

I need to know if these are bugs, and if not then what is the proper way to get the cell background color?
Post Reply