Microsoft KB Archive/61496

{| = Excel: Returning the Pathnames of Linked Documents =
 * width="100%"|

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 &quot;MySheet&quot;, use the following step in a macro:

A  - 1 | InsertLinkName 2 | val=INDEX(LINKS(&quot;MySheet&quot;),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.
 * }