Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Full Path Names in Excel.

Full Path Names in Excel

by Allen Wyatt
(last updated September 22, 2016)

6

When you open a workbook in Excel, the workbook name is displayed in the title bar. At times, it would be nice to display more than a simple workbook name in the title bar. Many people could profit by a way to display a full path name along with the workbook name in the title bar. Unfortunately, Excel does not provide a way to do this easily.

If you only need to know the full path name once in a while, then you can create a very simple macro and assign it to the QAT or a shortcut key. When you run the macro, the information in the title bar for the active window is changed to reflect the full path name. This macro, called ChangeCaption, is as follows:

Sub ChangeCaption()
     ActiveWindow.Caption = ActiveWorkbook.FullName
End Sub

The only drawback to this approach is that whenever you rename your workbook by saving it under a different name, the new file name (and path) are not updated in the title bar unless you rerun the macro.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7850) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Full Path Names in Excel.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Pasting Text with Track Changes

Track Changes is a great tool for developing documents. If you want to copy text from one document to another, with tracked ...

Discover More

Aligning Paragraphs in a Macro

Using a macro to format your document (or portions of your document) is not all that uncommon. If you want your macro to ...

Discover More

Changing the Link to Previous Default for Headers and Footers

When you insert a new section in your document, Word assumes you want the headers and footers in that section to be the same ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Stopping Date Parsing when Opening a CSV File

Excel tries to make sense out of any data that you import from a non-Excel file. Sometimes this can have unwanted results. ...

Discover More

Adding a File Path and Filename

If you need to stuff the current workbook's filename and path into a cell or a header or footer, you'll appreciate the ...

Discover More

Importing Many Files Into Excel

Importing a single file is easy. Importing a whole slew of files can be much more of a challenge.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two less than 2?

2016-09-24 05:49:32

Michael (Micky) Avidan

@Kevin Scanlon,
Try to add $A$1 to each and every instance of the CELL("filename") segment.
Like that:
...CELL("filename",$A$1)...
--------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2017)
ISRAEL


2016-09-23 10:37:05

Kevin Scanlon

Getting back to the point of this Tip, the suggestion to use "CELL" falls foul of the fact that this function is a volatile function and hence is re-calculated EVERY time ANY cell is changed in Excel.
This means that a "CELL" based formula located in workbook "A" will incorrectly report that it is in workbook "B" if both workbooks are open in the same instance of Excel and workbook "B" is the last one edited.
Try it and see
Kevin


2016-09-22 11:04:00

Roy

Nothing to do with this great tip, but in the latest version of Outlook if you are sending the sheet you have just worked on you can attach it quickly by just clicking on Attach file. A list of all the recent file worked on appears there.


2016-09-22 09:28:58

Kyle Fabris

I also find the "Document Location" textbox very handy. When you open a workbook, the fully qualified path is displayed. You can then copy/paste this path into any browser windows (e.g. Attach File in Outlook) thereby avoiding having to manually navigate to the file!

You can easily customize the QAT --> All Commands --> Document Location. Unfortunately, the same drawback exists. When you save a workbook, Excel doesn't automatically update the textbox like other MS Office apps do. You have to toggle to another open workbook or toggle to another application then go back to Excel for it to update.

Life is Good!

Kyle


2016-09-22 07:44:09

Michael (Micky) Avidan

@bettie lobato,
You suggestion presents the ActiveSheets name as well.
In order to present the Path and full file name only - try:
=SUBSTITUTE(LEFT(CELL("filename"),FIND("]",CELL("filename"))-1),"[",)
--------------------------
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2017)
ISRAEL


2014-05-31 14:36:29

bettie lobato

Simple way for complete path of file in Excel. On any cell in the file enter:
=cell("filename")


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.