View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.links
Davius Davius is offline
external usenet poster
 
Posts: 7
Default Hyperlink File Path Changes. Hair loss imminent.

On Sep 3, 2:27*pm, Bill Manville wrote:
I guess we need to see what H.Address is.
Put a
* Debug.Print H.Address
before the H.Address =... line and see what it shows in the debug
window.

If that doesn't give you any clues, post what it gives you in your
reply here and I will see if it gives me any.

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


Still the same error, no further info really....

Sub ChangeHype()
Dim WS As Worksheet
Dim H As Hyperlink
For Each WS In ActiveWorkbook.Worksheets
For Each H In WS.Hyperlinks
Debug.Print H.Address
H.Address = Mid(H.Address, InStrRev(H.Address,
"\Images")) <------ is the line the debug shows as the error.
Next
Next
End Sub


I was thinking of an alternate route of doing this when i thought
crossed my mind. Is there a way of mass CREATING hyperlinks, as now
all the files are in the same folder surely we could create a VBA that
links whatever filename is in the cell with the filename that
correspondes to in the folder.

I know i had the problem that all the image filenames were in the
***_***_***_*** format and all the cells are in the ***/***/***/***
but I can change this en mass with a simple find and replace '/' with
'_' thus matching the cells to the filenames. Then only needing to
create a crap load of hyperlinks again. There anyway of doing that via
VBA?

Thanks again for your time.