Hi
The code passes through all external links that are being changed at the same time. But it is only the last link that changes.
Why only the last, and not them all?
Hope I can get help in here (the first time I try it).
Private Sub cmdExecute_Click()
Dim wb As Workbook
Dim ExternalLinks As Variant
Dim i As Long
Set wb = ActiveWorkbook
ExternalLinks = wb.LinkSources(Type:=xlLinkTypeExcelLinks)
Application.DisplayAlerts = False
Application.AskToUpdateLinks = False
If VariantContent(ExternalLinks) = True Then 'Is there links?
For i = 1 To UBound(ExternalLinks)
wb.ChangeLink Name:=ExternalLinks(i), _
NewName:=Replace(LCase(ExternalLinks(i)), LCase(Me.txtOLD.Value), Me.txtNEW.Value), _
Type:=xlLinkTypeExcelLinks
Next
End If
Application.DisplayAlerts = True
Application.AskToUpdateLinks = True
Unload Me
End Sub
Bookmarks