repair broken links

G

Guido

I have many (1000) files with links to another file which
is however located in a different (sub)directory or in a
different path.
Whenever anyone changes the name of a subdirectory in
that path, all links are "lost".
Of course, I can do "update links" manually, file by file.
But is there an automatic way (or a trick) to do this?

Thanks for your help.
 
B

BrianB

Something like this :-

'------------------------------------------------
Sub ChangeLink()
Dim OldPath As String
Dim NewPath As String
'--------------------
OldPath = "C:\_CAPEX\Book1.xls"
NewPath = "C:\TEMP\Book1.xls"
ActiveWorkbook.ChangeLink _
Name:=OldPath, _
Newname:=NewPath, _
Type:=xlExcelLinks
End Sub
'------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top