We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

BackgroundColor not working?


i try to get the Background ARGB Color of a cell via:


As you can see in the screenshots provided the ARGB value for C2 is 0,0,0,0 (= black) whereas the cell appears White in Excel as no Color is set.

From my Point of view 0,0,0,0 is incorrect, it should be ??,255,255,255 (don’t know the Alpha Channel).

The pattern is “None” so maybe this could be the clue that i am looking for?

Or am I thinking totally wrong?

Question is: Where do I find the ARGB ??,255,255,255 for my cell as it is White and not black…


Thanks for the screenshot and details.

Please change your line of code to:

For your information, if the pattern is “Solid” or “None”, the foreground color (set/get) would be the shading color. For all other pattern types, you will use background color of the style.

See the document for your reference:

Hope, this helps a bit.

Doesn’t work, as you can see in my screenshot the foreground Color is 0,0,0,0, too.


Well, actually your C2 cell’s color is empty, this is not white color. See the following line of code to detect if the color is empty or not:
Sample code:

bool empty = c.GetStyle().ForegroundColor.IsEmpty;

Hi Amjad,

cool, understood! Is there a emptyColor.ToARGB so i can check what the “empty Color” is?



Well, I think an empty color represents a color which is null or uninitialized, so you cannot determine its ARGB value.

Of course :slight_smile: i thought about a Default Color (in this case White :)). I just use 255,255,255 now and hope that Excel has no Default Color that for instance can be set to black as I do it in my Dev-Studio.

Still grinning :slight_smile:

Have a nice evening.

Kind regards


We think, Style.Pattern should fulfill your needs. Because when it returns None, then foreground colors are invalid.