【问题标题】:Coloring of excel not workingexcel着色不起作用
【发布时间】:2016-08-29 19:46:42
【问题描述】:

来自:excel cell coloring

我有这个:

Excel.Worksheet myExcelWorkSheet;
myExcelWorkSheet.Cells[rowNumber, "B"].Interior.Color = (...)

而且它不识别内部部分..

错误 2“object”不包含“Interior”的定义,并且找不到接受“object”类型的第一个参数的扩展方法“Interior”(您是否缺少 using 指令或程序集引用?) D :\W\ProgGas\ProgGas\ExcelFile.cs 68 64 ProgGas

【问题讨论】:

    标签: c# excel


    【解决方案1】:

    试试这个:

    myExcelWorkSheet.GetRange(rowNumber,"B").Interor.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.YourColor);
    

    【讨论】:

    • 没有:/ Error 1 'Microsoft.Office.Interop.Excel.Worksheet' does not contain a definition for 'GetRange' and no extension method 'GetRange' accepting a first argument of type 'Microsoft.Office.Interop.Excel.Worksheet' could be found (are you missing a using directive or an assembly reference?) D:\W\ProgGas\ProgGas\ExcelFile.cs 68 42 ProgGas
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多