StatusBar Property

Applies To

Application Object, MenuItem Object, ToolbarButton Object.

Description

Returns or sets the text in the status bar. Read-write.

Remarks

For the Application object, this property returns False if Microsoft Excel has control of the status bar; set the property to False to restore the default status bar text. This works even if the status bar is hidden.

You can return or set the status bar text of custom menu items only, not built-in menu items.

Changing the macro assigned to a toolbar button with the OnAction property or the Assign Macro command (Tools menu) will reset the value of this property to match the status bar text of the macro.

See Also

DisplayStatusBar Property, HelpContextID Property, HelpFile Property.

Example

This example sets the status bar text to "Please be patient..." before it opens the workbook LARGE.XLS, and then it restores the text to the default.


oldStatusBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Application.StatusBar = "Please be patient..."
Workbooks.Open filename:="LARGE.XLS"
Application.StatusBar = False
Application.DisplayStatusBar = oldStatusBar

This example adds a new menu item to the Help menu in the Visual Basic Module menu bar and then sets the status bar text, the Help filename, and the Help context ID for the new menu item (note that the HelpFile and HelpContextId properties are available only in Windows).


Set menuObj = MenuBars(xlModule).Menus("Help")
Set newMenuItem = menuObj.MenuItems.Add(Caption:="&Read Me First", _
        OnAction:="readmeMacro", _
        Before:=1)
newMenuItem.StatusBar = "Read this topic before you begin"
newMenuItem.HelpFile = "C:\xl5\vba_xl.hlp"
newMenuItem.HelpContextID = 65535