ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
ConditionalFormat condFmt = wb.CreateConditionalFormat();
Condition cond =
condFmt.CreateCondition(
Condition.Comparison.CellValueGreaterThan,
"=100");
cond.Style.BackgroundColor = Palette.SystemColor.Green;
Style styleBold = wb.CreateStyle();
styleBold.Font.Bold = true;
cond.ApplyStyle(styleBold);
Range rng = wb.Worksheets[0].CreateRange("$B$2:$F$10");
rng.SetConditionalFormat(condFmt);
|