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

时间:2016-08-19 07:58:07

标签: excel vba excel-vba

DELETE FROM my_chat WHERE project_id ='" + project_id + "' AND id in (select id from my_chat order by id desc limit 2)
 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

这是显示错误的行。

是关于MS Office版本的吗?

我正在使用MS Officer 2010版本。

或者此属性太旧,我无法使用 .LineStyle = xlSlantDashDot

任何其他excel cell thick linestyle建议吗?

错误是

  

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

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

1 个答案:

答案 0 :(得分:1)

如果您打算设置范围的边框,则需要修改您的行:

.LineStyle = xlSlantDashDot

为:

.Borders.LineStyle = xlSlantDashDot