Possible to always display full file path in title bar (Excel 2010)?

Special K

Board Regular
Joined
Jun 20, 2011
Messages
83
Office Version
  1. 2010
Platform
  1. Windows
I am using Excel 2010 and the base filename is displayed in the window title bar. Is it possible to have the full path displayed without having to save every workbook as .xlsm (i.e. macro-enabled workbook)? I've found a couple possible solutions to my question online but they all involve macros. Doesn't that mean I will need to save all of my Excel workbooks as macro-enabled (i.e. xlsm) in order to use these solutions?
 
I would use xlsApp_WorkbookActivate instead of xlsApp_WorkbookOpen

If I do that then I no longer get the run time error listed above but the title bar doesn't contain the full path either.

Here is what I currently have:

VBA Code:
Option Explicit

Private WithEvents xlsApp as Application

Private Sub Workbook_Activate()
    Set xlsApp = ThisWorkbook.Application
End Sub

Private Sub xlsApp_WorkbookActivate(ByVal Wb As Workbook)
    Set ActiveWindow.Caption = Wb.FullName
End

Does that look correct?
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
This is the probably your best choice :
VBA Code:
Option Explicit

Private WithEvents xlsApp As Application

Private Sub Workbook_Open()
    Set xlsApp = Application
End Sub

Private Sub xlsApp_WindowActivate(ByVal Wb As Workbook, ByVal Wn As Window)
    Wn.Caption = Wb.FullName
End Sub
 
Upvote 0
This is the probably your best choice :
VBA Code:
Option Explicit

Private WithEvents xlsApp As Application

Private Sub Workbook_Open()
    Set xlsApp = Application
End Sub

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

Thanks, this worked. But why did this work and the other examples not work?
 
Upvote 0
This is the probably your best choice :
VBA Code:
Option Explicit

Private WithEvents xlsApp As Application

Private Sub Workbook_Open()
    Set xlsApp = Application
End Sub

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

What is the practical difference between xlsApp_WorkbookOpen and xlsApp_WindowActivate? Why would xlsApp_WorkbookOpen work correctly in Excel 2010 but throw an error in Excel 2013?
 
Upvote 0
What is the practical difference between xlsApp_WorkbookOpen and xlsApp_WindowActivate? Why would xlsApp_WorkbookOpen work correctly in Excel 2010 but throw an error in Excel 2013?
xlsApp_WorkbookOpen fires only once when a workbook is first opened. xlsApp_WindowActivate fires everytime a window is being activated . Bear in mind that a workbook can have more than one window.
 
Upvote 0

Forum statistics

Threads
1,213,558
Messages
6,114,297
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top