1

In Excel, using Interop dll I have following code.

            objWorkSheet.Range[objExcel.Cells[intHeaderRowCnt + 2, 6], objExcel.Cells[intCellRowCnt, 6]].Formula = "=RC[-3]-RC[-1]";
            objWorkSheet.Range[objExcel.Cells[intHeaderRowCnt + 2, 6], objExcel.Cells[intCellRowCnt - 1, 6]].FormatConditions.Add(Excel.XlFormatConditionType.xlCellValue, Excel.XlFormatConditionOperator.xlGreater, 0, 0);
            objWorkSheet.Range[objExcel.Cells[intHeaderRowCnt + 2, 6], objExcel.Cells[intCellRowCnt - 1, 6]].FormatConditions[1].Interior.ColorIndex = 3;
            objWorkSheet.Range[objExcel.Cells[intHeaderRowCnt + 2, 6], objExcel.Cells[intCellRowCnt - 1, 6]].FormatConditions.Add(Excel.XlFormatConditionType.xlCellValue, Excel.XlFormatConditionOperator.xlLess, 0, 0);
            objWorkSheet.Range[objExcel.Cells[intHeaderRowCnt + 2, 6], objExcel.Cells[intCellRowCnt - 1, 6]].FormatConditions[2].Interior.ColorIndex = 4;

How to achieve Conditional Formatting in Excel using Office Writer?

2
  • Code given is using Interop dll
    – user462997
    Jun 26, 2015 at 9:17
  • Please don't add comments to your post, this isn't a forum, it's a Q and A site. This means, it's expected that you edit your post and include this extra information. By doing this, it means other visitors can see the issue in your post (The question) without having to read a trail of nonsense to get the full story.
    – Dave
    Jun 26, 2015 at 9:19

0

You must log in to answer this question.

Browse other questions tagged .