Dim xl
Dim WS
Dim WB
Dim UR
Dim CL
Dim N
On Error Resume Next
Set xl = GetObject(, 'Excel.Application')
With xl
.Workbooks.Open 'I:\\\\\\\\MC_DEV\\\\\\\\Key_Projects\\\\\\\\VBS_Test\\\\\\\\Test.xls'
.Workbooks('Test.xls').Worksheets('Sheet1').Activate
.Visible = True
Set WB = .Workbooks('Test.xls')
Set WS = WB.Worksheets('Sheet1')
Set UR = WS.Range('A1:A10')
End With
WS.Range('A1').AddComment 'Hello'
For Each CL In UR
With CL
For N = 7 To 10
With .Borders(N)
.LineStyle = xlContinuous
.Weight = 2
.ColorIndex = xlAutomatic
End With
Next
End With
Next
With UR
For N = 7 To 10
With .Borders(N)
.LineStyle = xlContinuous
.Weight = 4
.ColorIndex = xlAutomatic
End With
Next
End With