evabb
evabb

Reputation: 405

Unable to Set the LineStyle Property of the Border Class?

 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

Upvotes: 0

Views: 2112

Answers (1)

Shai Rado
Shai Rado

Reputation: 33672

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

.LineStyle = xlSlantDashDot

to:

.Borders.LineStyle = xlSlantDashDot

Upvotes: 1

Related Questions