How to Show Full Path in Excel Title Bar?

Problem Statement:

Is there a way to display complete path of the document and not just the file name in the Excel title bar ?

e.g. I would like to see C:\MyExcelFiles\MonthlyBudget.xlsx in Excel title bar instead of just MonthlyBudget.xlsx

In Excel, there is no setting/straight way for us to display the full path in title bar, however we can apply following VBA code to achieve it:

Solution I: [Works only for 1 Excel File]

If you want to display Full Path in Title Bar only for a selected Excel Files

Copy below macro to ThisWorkbook module in the Excel File, save the file, and reopen the file to see the Full Path in Title Bar.

Private Sub Workbook_Open()
    ActiveWindow.Caption = ActiveWorkbook.FullName
End Sub

Check: Excel Tips & Tricks for a Successful and Efficient Data Analysis

Solution II: [Works as Default for all Excel files]

If you want to display Full Path in Title Bar for every Excel Files or by default

Copy below macro to ThisWorkbook module in your personal.xls file in XLStart folder, save the file, exit Excel Application [Close all excel files], and open any Excel file, now you will see the full path for all Excel files in title bar.

Public WithEvents xlApp As Excel.Application

Private Sub Workbook_Open()
    Set xlApp = Application
End Sub

Private Sub Workbook_Close()
    Set xlApp = Nothing
End Sub

Private Sub xlApp_WindowActivate(ByVal Wb As Workbook, ByVal Wn As Window)
    Wn.Caption = Wb.FullName
End Sub

How to add Macro to your Excel file

  1. Press Alt + F11 to open the Microsoft Visual Basic for Applications window.
  2. In the pop-up window, double-click on ThisWorkbook Module, then paste the given VBA code into the module.

Please let me know your thoughts in the comments section below.

Hope this helps! Happy Exelling!

Recommended for you:

Show Comments

No Responses Yet

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.