Excel: Returning the Pathnames of Linked Documents

Last reviewed: November 2, 1994
Article ID: Q61496

SUMMARY

In Microsoft Excel, if a link needs to be changed within a worksheet and the pathname is too long to display completely in the File Links dialog box, it may be impossible to distinguish the supporting document from other documents. This can cause confusion when trying to update the link.

Using the LINKS function in a command macro enables the macro to return the pathname and document name.

The Index command specifies which document, in the set of supporting worksheets, Excel should look up.

For example, to look up the third supporting worksheet from the list of worksheets supporting "MySheet", use the following step in a macro:

                  A
   -----------------------------
   1 | InsertLinkName
   2 | val=INDEX(LINKS("MySheet"),3)
   3 | =FORMULA(val)
   4 | =RETURN()

The resultant macro, when defined and run, inserts the complete pathname of the third supporting worksheet from the File Links dialog box into the active cell.


KBCategory: kbother
KBSubcategory:

Additional reference words: noupd


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 2, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.