Home |
Search |
Today's Posts |
#1
|
|||
|
|||
editing links
Is there a way to programmatically access links and change them in VBA?
Specifically, we're doing a migration and want to be able to change names of the links in a spreadsheet from .123 to .xls (converting the source files, then go back to the destination file and change all the extensions). TIA. |
#2
|
|||
|
|||
J. Freed wrote:
Is there a way to programmatically access links and change them in VBA? Specifically, we're doing a migration and want to be able to change names of the links in a spreadsheet from .123 to .xls (converting the source files, then go back to the destination file and change all the extensions). A macro like this should do it: Sub ChangeLinksFrom123ToXLS() Dim vLinks Dim iLink As Integer vLinks = ActiveWorkbook.LinkSources(xlExcelLinks) If IsEmpty(vLinks) Then Exit Sub For iLink = LBound(vLinks) To UBound(vLinks) If Right(vLinks(iLink), 3) = "123" Then ActiveWorkbook.ChangeLink vLinks(iLink), _ Left(vLinks(iLink), Len(vLinks(iLink)) - 3) & "xls", _ xlExcelLinks End If Next End Sub Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - respond to newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Links to other files | Excel Discussion (Misc queries) | |||
Manually update links | Excel Worksheet Functions | |||
HELP!!! Missing Links!!! | New Users to Excel | |||
Links in formulas change when another user runs a workbook | Excel Discussion (Misc queries) | |||
Why do my links break when I burn multiple Excel files to a CD? | Excel Worksheet Functions |