Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在Excel中设置条件图标集_C#_Excel - Fatal编程技术网

C# 在Excel中设置条件图标集

C# 在Excel中设置条件图标集,c#,excel,C#,Excel,使用c# 如何设置正在使用的IconSet? 下面的代码当前不工作。它给了我一组默认图标,但不是我想要的 Excel.IconSetCondition cfIconSet = (Excel.IconSetCondition)excelWorksheet.get_Range(cellNumber, cellNumber) .FormatConditions .AddIconSetCondition(); cfIconSet.IconSet = Excel.XlIco

使用c#
如何设置正在使用的IconSet?
下面的代码当前不工作。它给了我一组默认图标,但不是我想要的

Excel.IconSetCondition cfIconSet =
    (Excel.IconSetCondition)excelWorksheet.get_Range(cellNumber, cellNumber)
      .FormatConditions
      .AddIconSetCondition();
cfIconSet.IconSet = Excel.XlIconSet.xl3Flags;
解决

解决

cfIconSet.IconSet = cfIconSet.IconSet(Excel.XlIconSet.xl3Flags);