我正在开发Excel的vsto插件,我试图将颜色更改为Excel中的注释。如何将System.Drawing.Color从C#转换为Excel.ColorFormat?更改注释颜色
这是我的代码:
Excel.Range activeCell = _application.ActiveCell;
activeCell.AddComment("some text"));
activeCell.Comment.Shape.Fill.BackColor = Color.Red;
我得到的例外是:
无法隐式转换类型 '的System.Drawing.Color' 到“Microsoft.Office。 Interop.Excel.ColorFormat'
我无法找到如何在两种格式之间进行转换。
看一看[本](HTTP:// stackoverflo w.com/questions/27518048/how-to-assign-system-drawing-color-to-microsoft-office-interop-excel-colorformat)。 –