Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 C# 中为 Excel 工作表的某些特定单元格着色。我正在使用这段代码:
((Range)worksheet.Cells[2, 1]).Interior.Color = XlRgbColor.rgbDarkRed;
但它抛出了一个异常:
HRESULT 异常:0x800A03EC
我该如何解决这个问题?
试试这个它会解决你的问题
((Range)worksheet.Cells[i + 2, j + 1]).Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red);