Free Support Forum -

Background color property

I am using the following code to set the background color of a cell. When I open the exported spreadsheet, the color is not set.

sheet.Cells[row, col].Style.BackgroundColor = Color.Yellow;

What am I doing wrong?


Hi John,

In your case, please set the foreground color to yellow.

sheet.Cells[row, col].Style.ForegroundColor = Color.Yellow;

Background color only takes effect when the background pattern is not solid.