excel cell coloring

前端 未结 6 1798
刺人心
刺人心 2020-12-06 12:06

I am using c# to color particular cells of excel file. I am using:

Application excel = new Application();
Workbook wb = excel.Workbooks.Open(destPath);
 Work         


        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 12:18

    Cells[row, clmn] is a range so you don't need to call get_Range() and there is a enum that you can use for colors.

    ws.Cells[row, clmn].Interior.Color = XlRgbColor.rgbBlack;
    

提交回复
热议问题