Full Path to Workbook

Written by Allen Wyatt (last updated January 9, 2023)
This tip applies to Excel 2016


16

Becky recently updated to Excel 2016. In previous versions of the program she could display the File tab of the ribbon and then click Info to see the complete path and filename of the workbook. This was very useful for copying the information to send to a co-worker. In Excel 2016 the information isn't there any more. She wonders if there is another place to get this useful information with a single copy/paste.

Actually, the information is there, but Microsoft (as it is wont to do) changed how you access the information. Plus, they changed the precise nature of what is returned. Here's how to do it:

  1. Click the File tab of the ribbon.
  2. At the left side of the screen, click Info. (This is probably displayed by default.)
  3. Immediately under the file name is the location for the file. Left-click on this location and Excel displays a couple of choices. (See Figure 1.)
  4. Figure 1. Where Excel 2016 stores location information.

  5. Choose Copy Link to Clipboard.

If you are using a worksheet that is brand new (it hasn't been saved yet), then the above steps won't work because there is no file name or location to note.

When you paste the information from the Clipboard, you may be in for a little bit of a surprise. What you'll find is that the location is formatted as a URL. For instance, here is what I found when I copied the location of a workbook (Master Email List.xlsx) stored on my desktop:

file:///C:\Users\Administrator\Desktop\Master%20Email%20List.xlsx

You can, of course, remove the encoding characters in the URL and the protocol information to render a full path to the workbook. There are other ways to get the full path, however.

One alternative is to use a formula in a cell to get the desired information. Provided the workbook has been saved, this will return the desired information:

=cell("filename")

When I used this in a cell on a worksheet named "Original," here is what was returned:

C:\Users\Administrator\Desktop\[Master Email List.xlsx]Original

Obviously this returns a bit more information than just the full path name, so you'll need to (again) make some changes to the information.

Another alternative is to try this little trick:

  1. Press F12. Excel displays the Save As dialog box.
  2. Click once in the Location Bar at the top of the dialog box. Excel displays the path in which the current workbook is located.
  3. Press Ctrl+C. This copies the location to the Clipboard.
  4. Press Esc to dismiss the Save As dialog box.

You can then paste the location wherever you want, but note that it is simply the path to the folder containing the workbook; it does not include the workbook name.

Another alternative is to add a tool to the Quick Access Toolbar:

  1. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 and later versions, display the File tab of the ribbon and then click Options.)
  2. At the left side of the dialog box click Customize (Excel 2007) or Quick Access Toolbar (Excel 2010 or later versions). (See Figure 2.)
  3. Figure 2. The Quick Access Toolbar area of the Excel Options dialog box.

  4. Use the Choose Commands From drop-down list to choose All Commands.
  5. In the list of commands, choose Document Location.
  6. Click the Add button. The command is copied to the right side of the screen.
  7. Click OK.

Now, your QAT includes a text box that contains the full path for the current workbook. You can click once in the text box, press Ctrl+A to select the path, and press Ctrl+C to copy it to the Clipboard.

There is one caveat to using the Document Location tool. If you save a new workbook or use Save As to save the current workbook to a new name, you'll need to make an application other than Excel active for a moment (just click the other application's window to give it focus) and then come back to Excel. This causes Excel to update whatever is in the Document Location text box to the correct location.

Finally, if you are comfortable with using the Visual Basic Editor, you could follow these steps:

  1. Press Alt+F11. Excel displays the Visual Basic Editor.
  2. Press Ctrl+G. Excel displays (if necessary) and activates the Immediate window.
  3. Type "? activeworkbook.fullname" (without the quote marks) and press Enter. VBA displays the full path to the current workbook.
  4. Highlight the full path name and press Ctrl+C.
  5. Press Alt+Q to close the Visual Basic Editor.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13504) applies to Microsoft Excel 2016.

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

Searching for White Space

White space permeates our documents, and sometimes you'll need to search for that white space. Word makes it easy to ...

Discover More

Entering Data as Thousands

There are many different ways you may need to enter data in a worksheet. For instance, you might want to enter data in ...

Discover More

Printing Based on Cell Contents

Would you like to have a worksheet automatically printed when a particular cell contains a specified value? You can ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2013 For Dummies today!

More ExcelTips (ribbon)

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

Importing Huge Data Files

Sometimes, when importing data created by other programs, you may find that there is too much for Excel to handle. Here's ...

Discover More

Aligning Cells when Importing from CSV

When you import information from a CSV text file, Excel formats the data according to its default settings. Wouldn't it ...

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}] (all 7 characters, in the sequence shown) 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 more than 7?

2023-02-01 04:19:07

Kiwerry

Update on my 2021 comment: The "Copy as Path" option in the context menu has disappeared, so I couldn't replicate the method there. However, the "Save As" dialogue opened today with the file name selected, so Ctrl-C put it in the clipboard. A left click in the path at the top of the dialogue selected that and Ctrl-C put it in the clipboard, so both can be easily copied and pasted, particularly if a clipboard history tool like Ditto is used.

As I understand this site, Comments are meant for questions or useful hints, not for rants.


2023-02-01 02:36:53

Jim

Left clicking (or even right clicking) on the file path does nothing. It's not even clickable.

This article just exemplifies the ridiculousness of Windows. Microsoft wants to split the atoms when all is required is File>Save As.

Don't waste your time trying to learn Windows. it won't be around for much longer.


2021-12-07 04:42:59

Kiwerry

In Excel 365 I found that Save As, then a right-click on the file name and choosing "Copy as Path" puts the full path in the clipboard without any quote marks. My QAT is full and MS keeps on whittling away at the available space with all sorts of unnecessary (IMHO) stuff, so I baulked at adding another button to my QAT, but "Save As" is already there, so it takes two clicks to get the file path into the clipboard.

Background:
I tried RE Harrison's comment of 2016-12-18, but a right click on the file name brought no "Copy as Path" option in my Excel 365, so I looked around a bit more.


2020-08-12 08:25:25

azvonko

Update #2 of my previous comment:

Hallelujah, I've got it! Finally I found a place with warning about this issue - an old post from 2013, but still saving my days. Many thanks to Barry Houdini for this rare and valuable post.

https://superuser.com/questions/606048/how-do-you-insert-the-current-file-name-in-excel#:~:text=Try%20%3DCELL(%22filename%22,in%20a%20new%20unsaved%20workbook.

OK, I only have to conclude that it was meant as a "feature" in Excel, but ... as my local byword would say: it's not a sin, but ain't nice either.


2020-08-11 20:38:22

azvonko

Update of my previous comment:

At the same time it seems that workbook path obtained by Page Layout > Header correctly reflects the real workbook location as expected, so the previously mentioned "feature" smells probably more to a bug.


2020-08-11 15:35:24

azvonko

Hi Alen,

I just tried a solution with CALL("Filename") you mentioned here above and I discovered that, as it seems, it DOES NOT function fully in compliance with widely published descriptions I found. Therefore, I suppose you might be interested in checking up and revise these descriptions, as well as spread the word if justified.

When I applied the function =cell("filename") on Windows 10 - Office 2016 - HP notebook, I expected to ensure the file path of where the currently used xslx file consisting that function actually is located. Unfortunately, by opening (within the same Excel instance) more xlsx documents stored in different directories, I encountered very disappointing and confusing fact: after opening a new document in some different directory, the paths in previously correctly opened documents were automatically "updated" to point now also to the same file path as the last opened document! However, such a behaviour makes that function to me useless, even dangerous, because the user could think is working on one document, while actually is working on another one! Anyway, if this is a "feature" rather than a bug in Excel, I wonder where this function can be securely used at all.

I would be really glad to learn that in fact I missed something here and I made a mistake by myself, but so far I couldn't find anything like that.

Thanks for your attention.

Kind regards,
ZA


2020-02-22 10:39:42

J. Woolley

@Thomas Barc
Press F12 instead of File > Save As, but if you use File > Save As, then click the "current file path" at the top of the screen.


2020-02-21 14:48:23

Thomas Barc

In Excel 2010, the "Save As" button was a simple way to re-name a file OR to place a copy into another directory. In Excel 2010, the default action of "Save As" automatically suggested not only the current filename but also the current file path as the "new" name & location for saving -- making "Save As" act like "Save" but with special powers for the user to decide whether (or not) to edit the file name and/or the filepath for the currently open (and often newly edited copy of the) original file -- before actually "saving" the file "as" something else or somewhere else. This was also a quick & easy way to verify the location of an open file I was working on; I sometimes used "Save As" (when I only wanted to "Save") just to see the prompt of both the filename and location of the workbook I was working in.

In Excel2019, "Save AS" makes me hunt for the original path among an often long list of recent directories I've opened.

How do I modify my setting so Excel2019 suggests (defaults to) the current file path when using the "Save AS" command (like it did in Excel 2010)?


2019-06-05 04:24:35

Mikey

Thank you for this tip. It's helped me immensely.


2018-09-18 04:32:03

Branko

Hello,

Until this week, every time I used F12 in order to "save as" file name was completely the same but from this week, it always returns "copy of (file name)". Earlier, I saved the file with ____(1) if the file type is the same or with the same name if the type is different (xlsx/csv).
But now I can't run off "copy of ___"....
Do you have an idea what I need to do in order to change default file name (copy of__ ) during F12 keystroke in excel process?


2016-12-20 06:02:59

Willy Vanhaelen

@John Finley

The question mark is an alias for debug.print. So in the immediate window
"? activeworkbook.fullname" or
"debug.print activeworkbook.fullname"
are exactly the same.

You can use the first only in the Immediate window while the second is used in Subs or Functions for evaluation purposes.


2016-12-19 11:39:38

John Finley

Last tip is a great idea, but it works better if you preface the object with Debug.Print


2016-12-19 08:18:23

Ken

I have found it much easier by adding the 'Document Location' selection to the QAT. It is right there in front of you, all the time. Just click in it, and since the file path and name are already highlighted, just hit 'Ctrl+C' and it is in the ClipBoard.

If you only need the file name, not the path, just copy the name at the end of the string. Or if just the path, only copy it from the start of the string.


2016-12-18 16:31:07

RE Harrison

To extend MW's comment, one can right click on the file name and choose "Copy as Path" which copies the whole path and filename to the clipboard, which can then be pasted in emails, hyperlinks etc. (although some (non Microsoft?) programs balk at the quotation marks that are put at the beginning and end of the path|filename). I use this all the time and it's very handy.


2016-12-18 14:10:06

David Gray

This is an outstanding summary of the many ways to coax the file name from Microsoft Excel. Except for the QAT text box, I have used every one of these methods at one time or another.

Another variation of the worksheet formula that I have used from time to time involves extracting either the sheet name or the file name from the string returned by cell("Filename"). With a little more effort, and a helping of VBA, you can even extract the path for use in other formulas. Perhaps the must immediately useful such formula makes it possible to create hyperlinks to related documents that live in the same folder as the workbook. Getting the path from a formula makes these links almost unbreakable.


2016-12-17 19:39:05

MW

This frustrated me until I discovered that on the Info Tab, under the Properties column at the bottom you see:

Related Documents
Open File Location

Clicking on Open File Location, quickly opens the folder location in an Explorer window.

On the Home Tab of the Explorer ribbon click "Copy Path" -- it is copied to the clipboard

Or, clicking AFTER the last folder name in the navigation bar highlights the entire path, copy it and it is also on your clipboard.

No editing of a URL required either.


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.