Excel changes Hyperlinks when saved??

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??
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top