ThisCalculator

Everyday

Show File Path in Excel Title Bar

Updated · Standard formula, shown below

Show File Path in Excel Title Bar

You can show the full file path in Excel’s title bar by adding a simple line of VBA code to the workbook, or by using the built-in Document Properties feature. The VBA method is the most direct and updates automatically, while the Document Properties method requires manual setup. Below we explain both approaches, how they work, and how to choose between them.

Why Show the File Path in the Title Bar?

Excel’s default title bar shows only the file name, not the folder location. This is fine when you are working on one file, but it becomes a problem when you have several workbooks open with similar names (e.g., Report_Final.xlsx and Report_Final_v2.xlsx) or when you need to quickly tell a colleague where a file is saved. Showing the full path saves you from clicking File > Info every time you need to check the location.

Method 1: Using VBA (Automatic)

The most reliable way to display the full file path in the title bar is to use a small VBA macro. This method works on Windows and Mac (with slight differences in the VBA editor). Here is how to do it:

  1. Press Alt + F11 (Windows) or Option + F11 (Mac) to open the VBA editor.
  2. In the Project Explorer (left pane), find your workbook and expand it.
  3. Double-click ThisWorkbook to open its code window.
  4. Paste the following code:
Private Sub Workbook_Open()
    Me.Application.Caption = Me.FullName
End Sub

This code runs every time the workbook opens. It sets the application caption to the full path of the workbook. Note that this changes the caption for all open Excel windows, not just the current workbook. If you have multiple workbooks open, the title bar will show the path of the last one that opened. To avoid that, you can use a more targeted approach that updates the caption whenever you switch workbooks:

Private Sub Workbook_Activate()
    Me.Application.Caption = Me.FullName
End Sub

Place this in the ThisWorkbook module as well. It will update the caption each time you activate that workbook.

Method 2: Using Document Properties (Manual)

If you prefer not to use VBA, you can manually add the file path to the title bar via the Document Properties. This method is not automatic—you have to update it if the file moves—but it does not require any code.

  1. Click File > Info.
  2. Click Properties (top right) and select Advanced Properties.
  3. Go to the Summary tab.
  4. In the Title field, type the full path (e.g., C:\Users\YourName\Documents\Report.xlsx).
  5. Click OK.

Now the title bar will show that text. However, if you move or rename the file, you must update this manually. Also, the title bar will show the custom title instead of the file name, which can be confusing if you have many files open.

How to Remove the Path from the Title Bar

To revert to the default behavior, you need to clear the caption. If you used the VBA method, simply delete the code from the ThisWorkbook module and close the VBA editor. The next time you open the workbook, the title bar will revert to the file name. If you used the Document Properties method, go back to File > Info > Properties > Advanced Properties and clear the Title field.

Common Problems and Solutions

Here are a few issues you might encounter:

  • Caption does not update when switching workbooks: Use the Workbook_Activate event as shown above.
  • Path is too long to see fully: The title bar will truncate the path. You can hover over the title bar to see the full path in a tooltip, or use the File > Info path.
  • VBA is disabled: If macros are disabled, the code will not run. You can enable macros for that workbook, but be aware of security risks.
  • On Mac, the caption may not display exactly as expected: The VBA editor is slightly different, but the same code works. The title bar may show the path in a different format.

Alternatives to Showing the Path in the Title Bar

If you do not want to modify the title bar, there are other ways to see the full file path:

  • File > Info: The path is shown under the file name.
  • Quick Access Toolbar: Add the “Document Location� command to the Quick Access Toolbar. It displays the full path in a text box that you can copy from.
  • Keyboard shortcut: Press Ctrl + F12 (Windows) to open the Open dialog, which shows the current folder path.

Frequently Asked Questions

Does the VBA method work in Excel Online?

No. Excel Online does not support VBA macros, so you cannot use this method. You can use the Document Properties method, but it will only show the custom title, not the actual path.

Will the path update automatically if I move the file?

With the VBA method, yes—the caption is set every time the workbook opens, so it will reflect the new location. With the Document Properties method, no—you must update it manually.

Can I show only the folder name instead of the full path?

Yes, you can modify the VBA code to extract just the folder name. For example: Me.Application.Caption = ThisWorkbook.Path shows the folder path without the file name. Use ThisWorkbook.Path to get the folder, and ThisWorkbook.Name for the file name.

Why does the caption reset when I close and reopen Excel?

Because the caption is set by the VBA code when the workbook opens. If you open a different workbook first, that workbook’s caption will be used. The caption is not persistent across sessions unless you set it in a global add-in.

Is there a way to show the path without VBA or manual typing?

Yes, you can use the Document Location field on the Quick Access Toolbar. It shows the full path and updates automatically. This is the easiest non-VBA method.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.