71. Excel Tips - Display Excel File Path

Nick's picture


This is an extremely useful tip if you did not already know it:

  • There's a way in Excel to display the file path of the current open file.
  • You can add it to your toolbar, and then copy it from there whenever you need it.

Here's a screen shot of our Excel:

display-excel-file-path

 

Steps to display the file path of the current open file (Excel 2007):

  1. Right click on the ribbon
  2. Choose "Customise quick access toolbar"
  3. Select "All commands"
  4. Then choose "Document Location"
  5. Click "Add".. and it will appear on the right

display-excel-file-path

In Excel 2003, right click on the toolbar, and choose to display "web"

 

Note: If you have not saved the file, only the workbook name will be displayed.

Download sheet to practise how to Display Excel File Path in Excel

 

 

Training Video on how to Display Excel File Path in Excel:

AttachmentSize
display-excel-file-path.xls27.5 KB

This feature is gone in Excel 2010

I am using Excel 2010 and now Document Location is missing from the Command list. Is there any way to get it back and/or have the renamed it again?

Web>Address begat Document Location begat ????

document path

After several attempts & looking at various help messages, I noticed that after getting to the customize ribbon and the list of commands you can add, there's another box above it for "all commands". There I found "Document location".

Now, if I could only find a way to have the location automatically be inserted into the workbooks, I'd be happier. Also can't copy into the footer, where I'd prefer it.
Thanks if anyone can guide me on this.

Good site here!!
Sidney

Thanks! That worked for me!

Thanks! That worked for me!

Excel 2010

In the list of All Commands, the file name/path is called "Address".

Thanks

Thanks a bunch!!!

Thanks a lot, amazingly

Thanks a lot, amazingly simple yet so useful!

Nick's picture

full file path

 

don't have 2010 yet, but I have a formula that might help you:

 

=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)

returns:

Book6.xls

 

=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)&MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)

returns:

C:\Documents and Settings\Any Authorised User\My Documents\Book6.xls

 

having the file path is really useful

  • You can attach files to emails easily
  • if you want to open the file in a new Excel session, just copy the file name and go:

Start => Run => type "Excel" paste your path, and wrap it in '

so will look like this:

excel 'C:\Documents and Settings\Any Authorised User\My Documents\Book6.xls'

press Enter

 

Nick

Sheet names

This:
=LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1)&MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)

returns:
C:\Documents and Settings\Any Authorised User\My Documents\Book6.xls

is EXACTLY what I've spent the last 40 minutes looking for (apparently, my Google-Fu is weak today).

How do you amend that code so that it includes the sheet name, also? I'd like for the code to return:
C:\Documents and Settings\Any Authorised User\My Documents\Book6.xls | Sheet1
or
C:\Documents and Settings\Any Authorised User\My Documents\Book6.xls[Sheet1]

Thanks so much for your help and expertise.
~L~

Nick's picture

and if you just want the path

and if you just want the path without the file name, use this:

=LEFT(CELL("filename"),FIND("[",CELL("filename"),1)-1)

so for this:
'C:\Documents and Settings\Any Authorised User\My Documents\Book6.xls'

it returns this:
C:\Documents and Settings\Any Authorised User\My Documents\

thank you!!!

that was a beautiful, brilliant formula. So helpful and easy. Thank you!!!
---busy worker bee