这是我正在使用的代码:
rngData.BorderAround(Excel.XlLineStyle.xlContinuous,
Microsoft.Office.Interop.Excel.XlBorderWeight.xlThin,
Microsoft.Office.Interop.Excel.XlColorIndex.xlColorIndexNone,
System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.FromArgb(178, 178, 178)));
Run Code Online (Sandbox Code Playgroud)
无论我提供什么RGB值,边框颜色始终为黑色.