I am using c# to color particular cells of excel file. I am using:
Application excel = new Application();
Workbook wb = excel.Workbooks.Open(destPath);
Worksheet ws = wb.Worksheets[1];
ws.get_Range(ws.Cells[row, clmn]).Cells.Interior.Color = 36;
...to color cells, but this is not working. Can anyone help me out?
If you want to set color by color index, you need to use this method:
Cells[row, col].Interior.ColorIndex = 36;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With