PDA

View Full Version : Solved: Customviews Name



jofo
12-30-2007, 02:18 AM
Having selected a pre-defined custom view using View/Custom Views from Excel's menu I wish to display the name of the view in the status bar. How do I know what that name is?

p45cal
12-30-2007, 04:25 AM
I don't think it's easy, it may not even be possible..
however, how about adding a Custom Views dropdown which will show the last selected custom view, to a toolbar?
Right click on a toolbar and choose Customize, choose the Commands tab, highlight "View" in the left pane, then click and drag "CustomViews" in the right pane, to a toolbar.

p45cal

Emily
01-02-2008, 10:25 PM
Having selected a pre-defined custom view using View/Custom Views from Excel's menu I wish to display the name of the view in the status bar. How do I know what that name is?


Function CurrentView(Optional DummyArg As Variant) As String
Dim cbo As CommandBarComboBox

On Error Resume Next
Set cbo = Application.CommandBars.FindControl(ID:=950)
On Error GoTo 0
If cbo Is Nothing Then
With Application.CommandBars.Add(Temporary:=True)
Set cbo = .Controls.Add(ID:=950)
.Enabled = False
End With
End If

CurrentView = cbo.Text
End Function


Sub Test()
Application.DisplayStatusBar = True
Application.StatusBar = CurrentView
End Sub


Source okaizawa (http://www.eggheadcafe.com/forumarchives/excelmisc/sep2005/post24116085.asp)

jofo
05-11-2008, 12:34 AM
Thanks Emily, that seems to do the trick. Apologies for not getting back sooner.