How to set back colour for a Cell

Topics: Developer Forum
Jan 3, 2012 at 6:58 AM

How to set back colour for a Cell?

Jan 13, 2012 at 3:30 PM

ExcelWorksheet ws = pack.Workbook.Worksheets[1]; // if you are read a existing worksheet.
ws.Cells["A1"].Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
ws.Cells["A1"].Style.Fill.BackgroundColor.SetColor(Color.FromArgb(191, 191, 191)) // you can use a defined color with the property Color.Yellow