SOLVED

How to reference a cell in another workbook without storing absolute path to source file

%3CLINGO-SUB%20id%3D%22lingo-sub-1429939%22%20slang%3D%22en-US%22%3EHow%20to%20reference%20a%20cell%20in%20another%20workbook%20without%20storing%20absolute%20path%20to%20source%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1429939%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20whenever%20I%20reference%20a%20cell%20in%20another%20workbook%2C%20Excel%20stores%20the%20entire%20path%20to%20the%20other%20workbook%20even%20if%20the%20other%20workbook%20is%20in%20the%20same%20folder.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20absolute%20path%20to%20the%20source%20workbook%20is%20only%20valid%20in%20my%20own%20computer%2C%20but%26nbsp%3BI%20need%20to%20be%20able%20to%20share%20my%20workbooks%20(source%20and%20destination)%20with%20someone%20else.%20I'd%20like%20to%20make%20it%20so%20as%20long%20as%20both%20workbooks%20are%20in%20the%20same%20folder%2C%20only%20the%20file%20name%20should%20be%20stored%2C%20not%20the%20entire%20path.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20managed%20to%20make%20a%20reference%20using%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3D'source.xlsx'!cell_name%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20test%2C%20I%20make%20test%20copies%20of%20both%20source.xlsx%20and%20destination.xlsx%20in%20a%20new%20test%20folder.%20When%20I%20open%20the%20destination.xlsx%20file%20in%20the%20new%20test%20folder%2C%20i%20get%20a%20prompt%20to%20grant%20access%20to%20the%20source.xlsx%20file.%20Unfortunately%20after%20I%20give%20access%2C%20Excel%20changes%20the%20%3D'source.xlsx'!cell_name%20with%20a%20full%20path%20version%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3D'%2Fusers%2Fmsmith%2FGoogle%20Drive%2Ftestfolder%2Fsource.xlsx'!cell_name%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20configure%20Excel%20to%20save%20the%20links%20to%20external%20workbooks%20without%20storing%20the%20entire%20path%20name%20when%20both%20files%20are%20in%20th%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1429939%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1429959%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20reference%20a%20cell%20in%20another%20workbook%20without%20storing%20absolute%20path%20to%20source%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1429959%22%20slang%3D%22en-US%22%3EI%20think%20change%20links%20will%20work%20for%20what%20you%20are%20trying%20to%20do.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fexcelribbon.tips.net%2FT007364_Changing_Links.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fexcelribbon.tips.net%2FT007364_Changing_Links.html%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1429985%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20reference%20a%20cell%20in%20another%20workbook%20without%20storing%20absolute%20path%20to%20source%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1429985%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F684650%22%20target%3D%22_blank%22%3E%40fjkattan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EActually%20Excel%20works%20with%20relative%20links%20even%20if%20shows%20absolute%20path.%20But%20internally%20they%20are%20kept%20separately.%20If%20you%20move%20linked%20files%20to%20another%20location%2C%20Excel%20first%20checks%20relative%20part%20and%20if%20only%20another%20file%20is%20not%20found%20add%20to%20it%20absolute%20part.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMore%20about%20that%20is%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fhelp%2F328440%2Fdescription-of-link-management-and-storage-in-excel%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDescription%20of%20link%20management%20and%20storage%20in%20Excel%3C%2FA%3E%26nbsp%3BHowever%2C%20that%20is%20for%20Excel%20on%20Windows%2C%20I'm%20not%20if%20behavior%20is%20the%20same%20for%20Excel%20on%20Mac%20or%20not.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1429995%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20reference%20a%20cell%20in%20another%20workbook%20without%20storing%20absolute%20path%20to%20source%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1429995%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3BThank%20you.%20This%20is%20helpful.%3C%2FP%3E%3CP%3EYou%20wrote%3A%20%22%3CSPAN%3EActually%20Excel%20works%20with%20relative%20links%20even%20if%20shows%20absolute%20path%22%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20problem%20is%20I%20want%20to%20share%20a%20file%20without%20exposing%20the%20names%20of%20folders%20in%20my%20private%20hard%20disk.%26nbsp%3B%20For%20example%2C%20my%20destination%20workbook%20has%20a%20reference%20to%3A%3C%2FP%3E%3CP%3E%3D'%2FUsers%2Fmsmith%2FPrivateFolderName%2Fsource.clsx'!cell_name%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20email%20both%20workbooks%20to%20someone%20else%2C%20will%20the%20recipient%20see%20a%20reference%20to%20%22PrivateFolderName%22%20when%20he%20opens%20the%20destination%20workbook%3F%26nbsp%3B%20or%20will%20his%20version%20show%20a%20path%20that%20is%20specific%20to%20his%20private%20hard%20drive%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1430056%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20reference%20a%20cell%20in%20another%20workbook%20without%20storing%20absolute%20path%20to%20source%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1430056%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F684650%22%20target%3D%22_blank%22%3E%40fjkattan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYes%20and%20no.%3C%2FP%3E%0A%3CP%3EIf%20on%20your%20machine%20the%20link%20in%20File1%20on%20cell%20in%20File2%20looks%20like%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3D'D%3A%5CCompanyData%5CConfidentialFolder%5C%5BFile2.xlsx%5DSheet1'!%24A%241%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%2C%20you%20email%20files%20to%20another%20person%20who%20copy%2Fpaste%20them%20into%20C%3A%5COurPublicFolder%2C%20if%20File1%20will%20be%20opened%20in%20read%20mode%2C%20first%20that%20another%20person%20will%20see%20is%20your%20link%20(if%20focus%20is%20on%20linked%20cell).%20Chances%20are%20high%20since%20Excel%20recognizes%20files%20are%20from%20outside%2C%20open%20it%20in%20read%20mode%20and%20asks%20you%20if%20you%20trust%20the%20source%20and%20would%20like%20to%20edit%20the%20file.%3C%2FP%3E%0A%3CP%3EAs%20soon%20as%20the%20person%20shifted%20on%20file%20edit%20mode%2C%20link%20will%20be%20transformed%20to%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3D'C%3A%5COurPublicFolder%5C%5BFile2.xlsx%5DSheet1'!%24A%241%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Eand%20your%20initial%20link%20will%20disappear%20forever.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThus%20link%20works%20and%20your%20filepath%20is%20not%20visible%20after%20another%20person%20starts%20edit%20the%20file%20on%20his%20site.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYour%20initial%20link%20will%20be%20visible%20as%20well%20if%20Excel%20can't%20find%20File2.%20It%20simply%20alerts%20about%20broken%20link%20and%20continues%20to%20keep%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%20main%20goal%20is%20to%20secure%20initial%20link%20afraid%20there%20is%20no%20straightforward%20way.%20You%20may%20unzip%20File1%20and%20manually%20change%20root%20part%20of%20the%20path%20on%20something%20else%2C%20actually%20doesn't%20matter%20on%20what.%20Or%20first%20copy%20the%20files%20into%20temporary%20folder%20like%20c%3A%5Cdelivery%2C%20open%20and%20save%20them%20here%20and%20after%20that%20email%20outside.%20Not%20very%20suitable%20on%20practice%2C%20but%20security%20is%20quite%20often%20not%20suitable%20from%20time%20consuming%20and%20usability%20point%20of%20views.%20These%20are%20the%20only%20ways%20I%20know%2C%20perhaps%20some%20others%20exist%20as%20well.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hello, whenever I reference a cell in another workbook, Excel stores the entire path to the other workbook even if the other workbook is in the same folder.

 

The absolute path to the source workbook is only valid in my own computer, but I need to be able to share my workbooks (source and destination) with someone else. I'd like to make it so as long as both workbooks are in the same folder, only the file name should be stored, not the entire path. 

 

I've managed to make a reference using:

 

='source.xlsx'!cell_name

 

To test, I make test copies of both source.xlsx and destination.xlsx in a new test folder. When I open the destination.xlsx file in the new test folder, i get a prompt to grant access to the source.xlsx file. Unfortunately after I give access, Excel changes the ='source.xlsx'!cell_name with a full path version:

 

='/users/msmith/Google Drive/testfolder/source.xlsx'!cell_name

 

Is there a way to configure Excel to save the links to external workbooks without storing the entire path name when both files are in th

 

 

 

 

 

4 Replies
Highlighted
Highlighted

@fjkattan 

Actually Excel works with relative links even if shows absolute path. But internally they are kept separately. If you move linked files to another location, Excel first checks relative part and if only another file is not found add to it absolute part.

 

More about that is here Description of link management and storage in Excel However, that is for Excel on Windows, I'm not if behavior is the same for Excel on Mac or not.

Highlighted

@Sergei Baklan Thank you. This is helpful.

You wrote: "Actually Excel works with relative links even if shows absolute path"

The problem is I want to share a file without exposing the names of folders in my private hard disk.  For example, my destination workbook has a reference to:

='/Users/msmith/PrivateFolderName/source.clsx'!cell_name

 

If I email both workbooks to someone else, will the recipient see a reference to "PrivateFolderName" when he opens the destination workbook?  or will his version show a path that is specific to his private hard drive?

 

Highlighted
Best Response confirmed by fjkattan (New Contributor)
Solution

@fjkattan 

Yes and no.

If on your machine the link in File1 on cell in File2 looks like

='D:\CompanyData\ConfidentialFolder\[File2.xlsx]Sheet1'!$A$1

, you email files to another person who copy/paste them into C:\OurPublicFolder, if File1 will be opened in read mode, first that another person will see is your link (if focus is on linked cell). Chances are high since Excel recognizes files are from outside, open it in read mode and asks you if you trust the source and would like to edit the file.

As soon as the person shifted on file edit mode, link will be transformed to

='C:\OurPublicFolder\[File2.xlsx]Sheet1'!$A$1

and your initial link will disappear forever.

 

Thus link works and your filepath is not visible after another person starts edit the file on his site.

 

Your initial link will be visible as well if Excel can't find File2. It simply alerts about broken link and continues to keep it.

 

If the main goal is to secure initial link afraid there is no straightforward way. You may unzip File1 and manually change root part of the path on something else, actually doesn't matter on what. Or first copy the files into temporary folder like c:\delivery, open and save them here and after that email outside. Not very suitable on practice, but security is quite often not suitable from time consuming and usability point of views. These are the only ways I know, perhaps some others exist as well.