The important thing that you have not stated is where you want the links to point to. There are three choices: The activeworkbook (the workbook with the Links), ThisWorkbook (the workbook with the code) or wbk, which is a workbook named Book2.xlsm (you used Set wbk = Workbooks("Book2.xlsm") ) - or a fourth, which is another workbook altogether.
Whatever you do, you need to make sure that the sheet names in the workbook are the same as in the current linked workbook - try each of these three:
Option Explicit
Sub DeleteLinks1()
Dim strLinkNames() As Variant
Dim i As Integer
Dim wbk As Workbook
Set wbk = Workbooks("Book2.xlsm")
strLinkNames = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(strLinkNames) Then
For i = 1 To UBound(strLinkNames)
ActiveWorkbook.ChangeLink _
Name:=strLinkNames(i), _
NewName:=wbk.Name, _
Type:=xlExcelLinks
Next i
End If
End Sub
Sub DeleteLinks2()
Dim strLinkNames() As Variant
Dim i As Integer
Dim wbk As Workbook
Set wbk = Workbooks("Book2.xlsm")
strLinkNames = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(strLinkNames) Then
For i = 1 To UBound(strLinkNames)
ActiveWorkbook.ChangeLink _
Name:=strLinkNames(i), _
NewName:=ThisWorkbook.Name, _
Type:=xlExcelLinks
Next i
End If
End Sub
Sub DeleteLinks3()
Dim strLinkNames() As Variant
Dim i As Integer
Dim wbk As Workbook
Set wbk = Workbooks("Book2.xlsm")
strLinkNames = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(strLinkNames) Then
For i = 1 To UBound(strLinkNames)
ActiveWorkbook.ChangeLink _
Name:=strLinkNames(i), _
NewName:=ActiveWorkbook.Name, _
Type:=xlExcelLinks
Next i
End If
End Sub
Bookmarks