April 2006
Beginner
1114 pages
98h 16m
English
workbook.ChangeLink(Name, NewName, [Type])
Changes the source of a link.
|
Argument |
Settings |
|---|---|
|
|
The name of the link to change. Link names are returned by the |
|
|
The source of the new link. |
|
|
Use |
For example, the following code iterates through the Excel links in a workbook and changes links from the test1.xls file to test2.xls:
Dim link, linkSources, newLink As String
newLink = ThisWorkbook.Path & "\test2.xls"
linkSources = ThisWorkbook.linkSources(xlLinkTypeExcelLinks)
If IsArray(linkSources) Then
For Each link In linkSources
If InStr(link, "test1.xls") Then _
ThisWorkbook.ChangeLink link, newLink, xlLinkTypeExcelLinks
Next
End IfRead now
Unlock full access