Set custom BackgroundColor of a Excel sheet cell using epplus c#

后端 未结 4 1050
情话喂你
情话喂你 2021-02-01 00:20

The problem:

I am using EEPlus.

I am stuck at applying a hex color code, e.g. #B7DEE8, for a cell in my Excel sheet.

I got the following (wo

4条回答
  •  感情败类
    2021-02-01 00:41

    This is working well.

    Dim objExcel As New ExcelPackage
    Dim Sheet As ExcelWorksheet = objExcel.Workbook.Worksheets.Add("SheetName")
    Sheet.Cells["A1"].Style.Fill.PatternType = Style.ExcelFillStyle.Solid
    Sheet.Cells["A1"].Style.Fill.BackgroundColor.SetColor(Color.FromArgb(170, 170, 170))
    

提交回复
热议问题