raven_squire
Board Regular
- Joined
- Jan 13, 2013
- Messages
- 99
Hello,
This appears to be a common problem experianced by people but I am having trouble getting around it.
I have absolute hyperlinks on my excel spread sheet and when it is saved Excel appears to remove the folder that the workbook is stored in from the address. I also have other hyperlinks on the spread sheet that point to locations in the same spread sheet.
I have read that changing the Hyperlink base will stop excel from changing the hyperlink address. When I do that the hyperlinks that point to the workbook stop working and have several warnings.
I am happy to use relitive hyperlinks but they also have the workbooks folder removed from the link when the workbook is saved.
This is some of the code that I am using for the relitive hyperlink
'relitive path that excel likes to change.
savepath = "ScreenShots"
'Absolute path that excel likes to change.
'savepath = Application.ActiveWorkbook.Path & "\ScreenShots"
savename = Format(Year(sheets(Target_sheet).Range("a" & Target_Row)), "0000") & blah blah
savepathandname = savepath & savename
'generate hyperlink
With sheets(Target_sheet)
.Hyperlinks.Add Anchor:=.Range("r" & Target_Row), Address:=savepathandname, TextToDisplay:="View"
End With
Does anyone have any suggestions on what I can do to get these hyperlinks to work??
This appears to be a common problem experianced by people but I am having trouble getting around it.
I have absolute hyperlinks on my excel spread sheet and when it is saved Excel appears to remove the folder that the workbook is stored in from the address. I also have other hyperlinks on the spread sheet that point to locations in the same spread sheet.
I have read that changing the Hyperlink base will stop excel from changing the hyperlink address. When I do that the hyperlinks that point to the workbook stop working and have several warnings.
I am happy to use relitive hyperlinks but they also have the workbooks folder removed from the link when the workbook is saved.
This is some of the code that I am using for the relitive hyperlink
'relitive path that excel likes to change.
savepath = "ScreenShots"
'Absolute path that excel likes to change.
'savepath = Application.ActiveWorkbook.Path & "\ScreenShots"
savename = Format(Year(sheets(Target_sheet).Range("a" & Target_Row)), "0000") & blah blah
savepathandname = savepath & savename
'generate hyperlink
With sheets(Target_sheet)
.Hyperlinks.Add Anchor:=.Range("r" & Target_Row), Address:=savepathandname, TextToDisplay:="View"
End With
Does anyone have any suggestions on what I can do to get these hyperlinks to work??