Private Sub CommandButton2_Click()
With ListBox1
If .ListIndex = -1 Then Exit Sub
i = .List(.ListIndex, 1)
ActiveWorkbook.BreakLink Name:=.List(.ListIndex, 2), Type:=xlExcelLinks
End With
UserForm_Initialize
End Sub
Private Sub UserForm_Initialize()
aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
With ListBox1
.Clear
.ColumnCount = 3
.ColumnWidths = "50;0;0"
If Not IsEmpty(aLinks) Then
For i = 2 To UBound(aLinks)
.AddItem "Link " & i & " : " & aLinks(i)
.List(.ListCount - 1, 1) = i
.List(.ListCount - 1, .ColumnCount - 1) = aLinks(i)
Next i
End If
End With
End Sub