Unable to Set the LineStyle Property of the Border

2019-09-10 23:38发布

 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

This is the line showing the error .

Is it about the MS office version ?

I m using MS officer 2010 version .

Or this property is too old ,that I can 't use xlSlantDashDot .

Any other excel cell thick linestyle suggested ?


The error is

XL2002: Error Message: Run-Time Error 1004: Unable to Set the LineStyle Property of the Border Class

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

1条回答
倾城 Initia
2楼-- · 2019-09-11 00:36

If you intend to set the borders of your range, then You need to modify your line:

.LineStyle = xlSlantDashDot

to:

.Borders.LineStyle = xlSlantDashDot
查看更多
登录 后发表回答