Display a File Name in the Microsoft Word or Excel Status Bar
Question details
The user wants to see the active document or workbook name in the built-in status bar.

- Product
- Microsoft Word and Microsoft Excel
- Device & OS
- not provided
- Scenario
- Quickly identify the open file without using the truncated Document Location field.
- Observed behavior
- The user wants the file name to appear in the status bar instead of navigating to the end of the file path.
Open the document or workbook whose name you want to display, and make sure you can use VBA macros in your desktop Office application. Word and Excel require different object names in the macro.
Display the active file name with a VBA macro
Use a short macro to put the current file name in the status bar when you need it.
Office does not provide a supported way to add a permanent custom file-name item to its built-in status bar. The macro displays text temporarily; in Word, normal status information can overwrite it when you type or move the cursor.
In desktop Word or Excel, open Developer > Visual Basic. If the Developer tab is hidden, enable it through File > Options > Customize Ribbon.
In the VBA editor, select the project where you want to store the macro, then choose Insert > Module.
For Word, enter: Sub ShowFileName() Application.StatusBar = ActiveDocument.Name End Sub For Excel, enter: Sub ShowFileName() Application.StatusBar = ActiveWorkbook.Name End Sub
Return to the open document or workbook, choose Developer > Macros, select ShowFileName, and click Run. Run it again whenever you need to redisplay the name.
To run the macro from a button, open File > Options > Quick Access Toolbar, select Macros from the command list, and add ShowFileName.

View Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Office files. It supports common Word and Excel formats, making it easy to move existing documents and workbooks into WPS. It does not change the built-in status bar in Microsoft Office.

Frequently Asked Questions
Can I permanently add the file name to the Word status bar?
No. Word does not provide a supported option to add a permanent custom file-name item to its built-in status bar. A VBA macro can display the name temporarily, but normal status messages can overwrite it.
Why does the Word macro produce an error in Excel?
ActiveDocument is a Word object. In Excel, use Application.StatusBar = ActiveWorkbook.Name to display the active workbook name.
How can I run the macro without opening the VBA editor each time?
Choose Developer > Macros, select ShowFileName, and click Run. For faster access, add the macro under File > Options > Quick Access Toolbar.
How do I restore Excel's normal status bar messages?
In the Excel VBA editor, run Application.StatusBar = False to return control of the status bar to Excel.




