Office Settings & Configuration

Display a File Name in the Microsoft Word or Excel Status Bar

Huma Ashraf ChHuma Ashraf Ch Nov 27, 2026 869 views

Question details

The user wants to see the active document or workbook name in the built-in status bar.

How to Display a File Name in the Word or Excel 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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA editor

In desktop Word or Excel, open Developer > Visual Basic. If the Developer tab is hidden, enable it through File > Options > Customize Ribbon.

2
Insert a module

In the VBA editor, select the project where you want to store the macro, then choose Insert > Module.

3
Add the appropriate macro

For Word, enter: Sub ShowFileName() Application.StatusBar = ActiveDocument.Name End Sub For Excel, enter: Sub ShowFileName() Application.StatusBar = ActiveWorkbook.Name End Sub

4
Run the macro

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.

5
Add quick access

To run the macro from a button, open File > Options > Quick Access Toolbar, select Macros from the command list, and add ShowFileName.

Display the active file name with a VBA macro
Use the right object for each app: ActiveDocument.Name is for Word; use ActiveWorkbook.Name in Excel. Using the Word object in Excel can cause an object-required error.
Free Microsoft Office alternative

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.

Open documents and workbooks in a familiar tabbed workspaceCompatible with Microsoft Word DOCX and Excel XLSX filesFree, lightweight tools for everyday document and spreadsheet workMove existing Office files into WPS without starting over
microsoft office alternative - wps 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.