ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Links and Linking in Excel (https://www.excelbanter.com/links-linking-excel/)
-   -   global change to document hyperlink root directory (https://www.excelbanter.com/links-linking-excel/18599-global-change-document-hyperlink-root-directory.html)

mmekennedy

global change to document hyperlink root directory
 
Ii have an excel file that was corrupted and restored and now that i placed
it back in the original folder 100's of links are wrong and point to restored
folder ... is there a way to get the links to point to the correct path vs
the restore path?

Bill Manville

Mmekennedy wrote:
Ii have an excel file that was corrupted and restored and now that i placed
it back in the original folder 100's of links are wrong and point to restored
folder ... is there a way to get the links to point to the correct path vs
the restore path?


If you have links to a few files, Edit / Links / Change Source
If you have links to 100s of files, you could try my LinkManager.
(It is designed to change links in many files, but could probably be persuaded
to do just the one).

If Edit / Links is too daunting, email me at Bill_Manville @ compuserve.com
(without the spaces) for a copy of LinkManager

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup


mmekennedy

These are hyperlinks (file pointers to documents in a folder on the network)
- edit - link does not work in this instance - any other ideas\suggestions?

"Bill Manville" wrote:

Mmekennedy wrote:
Ii have an excel file that was corrupted and restored and now that i placed
it back in the original folder 100's of links are wrong and point to restored
folder ... is there a way to get the links to point to the correct path vs
the restore path?


If you have links to a few files, Edit / Links / Change Source
If you have links to 100s of files, you could try my LinkManager.
(It is designed to change links in many files, but could probably be persuaded
to do just the one).

If Edit / Links is too daunting, email me at Bill_Manville @ compuserve.com
(without the spaces) for a copy of LinkManager

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup



JulieD

Hi

i've recently written a macro to deal with a workbook with 300+ hyperlinks
when the IT dept renamed the folders on the server (sweet people) ... if
you'ld like to give me an example of the wrong address and the right address
i might be able to modify it to work for you.

Cheers
JulieD

"mmekennedy" wrote in message
...
These are hyperlinks (file pointers to documents in a folder on the
network)
- edit - link does not work in this instance - any other
ideas\suggestions?

"Bill Manville" wrote:

Mmekennedy wrote:
Ii have an excel file that was corrupted and restored and now that i
placed
it back in the original folder 100's of links are wrong and point to
restored
folder ... is there a way to get the links to point to the correct
path vs
the restore path?


If you have links to a few files, Edit / Links / Change Source
If you have links to 100s of files, you could try my LinkManager.
(It is designed to change links in many files, but could probably be
persuaded
to do just the one).

If Edit / Links is too daunting, email me at Bill_Manville @
compuserve.com
(without the spaces) for a copy of LinkManager

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup





Bill Manville

Sorry - I failed to read the title of your post - obviously you were
talking about hyperlinks.

LinkManager will be able to change hyperlinks for you.

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup


mmekennedy

Julie D

It varies from worksheet to worksheet .. but if you could sendme the root
macro I would be able to modfiy it accordingly - please advise

is my email

"JulieD" wrote:

Hi

i've recently written a macro to deal with a workbook with 300+ hyperlinks
when the IT dept renamed the folders on the server (sweet people) ... if
you'ld like to give me an example of the wrong address and the right address
i might be able to modify it to work for you.

Cheers
JulieD

"mmekennedy" wrote in message
...
These are hyperlinks (file pointers to documents in a folder on the
network)
- edit - link does not work in this instance - any other
ideas\suggestions?

"Bill Manville" wrote:

Mmekennedy wrote:
Ii have an excel file that was corrupted and restored and now that i
placed
it back in the original folder 100's of links are wrong and point to
restored
folder ... is there a way to get the links to point to the correct
path vs
the restore path?


If you have links to a few files, Edit / Links / Change Source
If you have links to 100s of files, you could try my LinkManager.
(It is designed to change links in many files, but could probably be
persuaded
to do just the one).

If Edit / Links is too daunting, email me at Bill_Manville @
compuserve.com
(without the spaces) for a copy of LinkManager

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup






JulieD

Hi

here's the code
---------
Sub updatehlinks()
Dim fname As String
Dim pname As String
Dim dval
Dim i As Long
Dim j As Long
fname = "*.xls" 'filename
pname = "C:\temp\excel" 'folder to use
Application.ScreenUpdating = False
With Application.FileSearch
.NewSearch
.LookIn = pname
.SearchSubFolders = False
.Filename = fname 'check to see if any files match the fname
If .Execute() 0 Then
For i = 1 To .FoundFiles.Count
Workbooks.Open .FoundFiles(i)
'step through the sheets updating the hyperlinks
fname = ActiveWorkbook.Name
For j = 1 To Sheets.Count
Sheets(j).Activate
For Each hlnk In ActiveSheet.Hyperlinks
hlnk.Address =
Application.WorksheetFunction.Substitute(hlnk.Addr ess, "group", "groups", 1)
Next
Next
Workbooks(fname).Save
Workbooks(fname).Close
Next
End If
End With
Application.ScreenUpdating = True
End Sub
-------
it's designed to cycle through all the workbooks in a folder, looking for
the hyperlinks and changing a name of the folder in the path from "group" to
"groups" (don't you just love IT people!)

hope it helps
Cheers
JulieD

"mmekennedy" wrote in message
...
Julie D

It varies from worksheet to worksheet .. but if you could sendme the root
macro I would be able to modfiy it accordingly - please advise

is my email

"JulieD" wrote:

Hi

i've recently written a macro to deal with a workbook with 300+
hyperlinks
when the IT dept renamed the folders on the server (sweet people) ... if
you'ld like to give me an example of the wrong address and the right
address
i might be able to modify it to work for you.

Cheers
JulieD

"mmekennedy" wrote in message
...
These are hyperlinks (file pointers to documents in a folder on the
network)
- edit - link does not work in this instance - any other
ideas\suggestions?

"Bill Manville" wrote:

Mmekennedy wrote:
Ii have an excel file that was corrupted and restored and now that i
placed
it back in the original folder 100's of links are wrong and point to
restored
folder ... is there a way to get the links to point to the correct
path vs
the restore path?


If you have links to a few files, Edit / Links / Change Source
If you have links to 100s of files, you could try my LinkManager.
(It is designed to change links in many files, but could probably be
persuaded
to do just the one).

If Edit / Links is too daunting, email me at Bill_Manville @
compuserve.com
(without the spaces) for a copy of LinkManager

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup









All times are GMT +1. The time now is 07:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com