Unfortunately this is a long standing bug in MSFT's code.
You could try this but it may not work as expected.
Sub TableLines()
Dim tbl As Table
Dim Icol As Integer
Dim Irow As Integer
Dim i As Integer
On Error GoTo err
Set tbl = ActiveWindow.Selection.ShapeRange(1).Table
' hide selected borders
Call CommandBars.ExecuteMso("BorderNone")
DoEvents
'exit if no selected table
If err.Number <> 0 Then Exit Sub
For Irow = 1 To tbl.Rows.Count
For Icol = 1 To tbl.Columns.Count
If tbl.Cell(Irow, Icol).Selected Then
For i = 1 To 3 Step 2
With tbl.Cell(Irow, Icol).Borders(i)
.Visible = msoTrue
.ForeColor.RGB = RGB(180, 180, 180)
.Weight = 1
End With
Next i
End If
Next Icol
Next Irow
Exit Sub ' usual exit
err: 'error
MsgBox "Please select table rows / cells and try again"
End Sub