无法设置边框类的LineStyle属性?

With Sheets(1).Range(Cells(row + 1, 1), Cells(row + 1, "V")) .Interior.ColorIndex = 48 ' .Borders (xlInsideHorizontal) .LineStyle = xlSlantDashDot .Weight = xlThin .ColorIndex = 15 .Font.Name = "Times New Roman" .Font.Size = 25 End With 

  .LineStyle = xlSlantDashDot 

这是显示错误的行。

是关于MS Office版本吗?

我使用MS官员2010版本。

或者这个属性太旧,我不能使用xlSlantDashDot

任何其他Excel单元格粗线条build议?


错误是

XL2002:错误消息:运行时错误1004:无法设置边框类的LineStyle属性

https://support.microsoft.com/en-us/kb/277577

如果你打算设置你的范围的边界,那么你需要修改你的行:

 .LineStyle = xlSlantDashDot 

至:

 .Borders.LineStyle = xlSlantDashDot