Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.links
|
|||
|
|||
![]()
You could adapt the code posted in the other thread to ChangeLink
rather than UpdateLink So, instead of Sub UpdateActiveWorkbookLinks() make it Sub ChangeMasterWorkbookLink() Dim vLinkSources Dim iLinkSource As Integer Dim AnySheet As Worksheet For Each AnySheet In ActiveWorkbook.Worksheets ActiveWorkbook.Worksheets(AnySheet.Name).Unprotect Password:="mypassword" Next vLinkSources = ActiveWorkbook.LinkSources(xlExcelLinks) If Not IsEmpty(vLinkSources) Then For iLinkSource = LBound(vLinkSources) To UBound(vLinkSources) If Instr(LCase(vLinkSources(iLinkSource), "master.xls")0 Then ActiveWorkbook.ChangeLink vLinkSources(iLinkSource), _ "\\Server\MyDir\mySubDir\master.xls" , xlExcelLinks End If Next End If For Each AnySheet In ActiveWorkbook.Worksheets ActiveWorkbook.Worksheets(AnySheet.Name).Protect Password:="mypassword" Next End Sub and call it from the code that loops through all xls files in a directory. Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - respond to newsgroup |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
History worksheet - can it remain viewable after saving? | Excel Worksheet Functions | |||
Edit Links: Changing links on a protected worksheet | Excel Discussion (Misc queries) | |||
Updating links from one worksheet to another worksheet | Excel Worksheet Functions | |||
saving atable of links into spreadsheet | Excel Discussion (Misc queries) | |||
worksheet links | Excel Worksheet Functions |