ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
//--- Create a range of the cells that will have the conditional formatting.
Range vRange = wb.Worksheets[0].CreateRange("$B$2:$F$10");
Area vArea = vRange.Areas[0];
//--- Get the conditional format for the first cell within this range.
ConditionalFormat vCndFmt = vArea[0,0].ConditionalFormat;
//--- Modify the first condition.
Condition vCondition = vCondFmt.Condition[0];
vCondition.ChangeConditionType(Condition.Comparison.CellValueLessThan, "=100");
vRange.SetConditionalFormat(vCondFmt);
|