Change Excel Cell Color

This colors the specified cells with the selected color.

This script will require adding using OfficeOpenXml; to the namespaces section.

excelDocument.Cells[x, y].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
excelDocument.Cells[x,y].Style.Fill.BackgroundColor.SetColor(0,0,0,0);

Last updated

Was this helpful?