I am trying to change the color in Row mod 2 = 0 in a Range between B4 to F500 which it is a list of values. I want alternate the background color of entire Row.
I am executing this:
Range c1 = worksheet.Range["B4"];
Range c2 = (Range) worksheet.Range[F500];
Range range = worksheet.get_Range(c1, c2);
range.Value = arr;
var formatCell = (FormatCondition)range.Rows.FormatConditions.Add(XlFormatConditionType.xlExpression, XlFormatConditionOperator.xlEqual, "=MOD(ROW(),2) = 0");
formatCell.Interior.Color = Color.FromArgb(243, 243, 243);
until value = arr
the code it is working ok but when I want to change the color it is giving me this error:
THE PARAMETER IS INCORRECT
What is wrong?
could you please help me?
I don't want to make a loop because it is too slow
I am using c# and Excel 365.
question from:
https://stackoverflow.com/questions/65902070/excel-interop-c-changing-row-color 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…