- #1
DoubleHubble
- 9
- 0
Excel VBA change (or "edit") links Macro
I have a Excel spreadsheet that has several links in it which I need to change to a different computer/user. The links are all the same and to change the source I have to go to "Edit Links" and manually change the location to the specific location on my computer.
For example my link is: 'C:\Users\My Name\AppData\Roaming\Microsoft\AddIns'
What is the quickest way to change/automate this link upon opening this file from a different user's directory (to say: 'C:\Users\Any Name\AppData\Roaming\Microsoft\AddIns')?
So not only do I need to change the link, but I need to change it to the current user's name -- which could be anyone.
To summarize I want the cells' values to change from:
='C:\Users\My Name\AppData\Roaming\Microsoft\AddIns\Addin.xla'!ADDFUNCTION(S3,$B$2)
to:
='C:\Users\Any Name\AppData\Roaming\Microsoft\AddIns\Addin.xla'!ADDFUNCTION(S3,$B$2)
without the user (Any Name) having to do anything -- ADDFUNCTION is a simple/dummy addin function that I made to add two cells together for purposes of answering this question.
I have a Excel spreadsheet that has several links in it which I need to change to a different computer/user. The links are all the same and to change the source I have to go to "Edit Links" and manually change the location to the specific location on my computer.
For example my link is: 'C:\Users\My Name\AppData\Roaming\Microsoft\AddIns'
What is the quickest way to change/automate this link upon opening this file from a different user's directory (to say: 'C:\Users\Any Name\AppData\Roaming\Microsoft\AddIns')?
So not only do I need to change the link, but I need to change it to the current user's name -- which could be anyone.
To summarize I want the cells' values to change from:
='C:\Users\My Name\AppData\Roaming\Microsoft\AddIns\Addin.xla'!ADDFUNCTION(S3,$B$2)
to:
='C:\Users\Any Name\AppData\Roaming\Microsoft\AddIns\Addin.xla'!ADDFUNCTION(S3,$B$2)
without the user (Any Name) having to do anything -- ADDFUNCTION is a simple/dummy addin function that I made to add two cells together for purposes of answering this question.