Forum Discussion
EFlonk
Oct 18, 2023Copper Contributor
Excel hyperlink changes to local path
Hello all, I have a problem with the path of hyperlinks in an excel file changing. I have a file which has a list of hyperlinks to different drawings, these drawings are stored on the company sharepo...
Patrick2788
Oct 18, 2023Silver Contributor
If all the hyperlinks in the workbook go to the same SP document library, you could use a hyperlink base (Stored in the properties of the workbook so it travels with the worbook):
See: Set the base address for links in a workbook
https://support.microsoft.com/en-us/office/work-with-links-in-excel-7fc80d8d-68f9-482f-ab01-584c44d72b3e
See: Set the base address for links in a workbook
https://support.microsoft.com/en-us/office/work-with-links-in-excel-7fc80d8d-68f9-482f-ab01-584c44d72b3e
- mukulmadanOct 25, 2024Copper Contributor
I am having the same problem (absolute file paths changed to relative paths) when I save my excel with hyperlinks (added through VBA for excel). This can create problems when I share this file with another user/ when I copy the hyperlinks to another file (I use VBA for excel for the copy).
I do not see any option in the Hyperlinks.Add method to "retain" the absolute path names.
I am using Excel 2019 on am MacBook Pro (M2) with the current/ latest version of the MacOS.
I do not see the options for setting a base address that you mentioned for Excel 2019 on the MacOS version. Also, I'd like to do that through VBA to reduce errors.
- EFlonkOct 20, 2023Copper ContributorThank you, this might indeed be a solution to my problem. Having the base adress in the file will solve my problem. When I click the cell it will go to the desired file.
However a next problem it created. My code now does not recognize the hyperlink, for my code cell.hyperlink.count>0 condition is not met. The code now skips the cells with this new hyperlink in it.
Any suggestions on this?- EFlonkOct 20, 2023Copper ContributorNevermind! Rookie mistake, I have it fixed.
thanks for your initial suggestion, think it will help me out!