none
add popup menu in the status bar popup menu RRS feed

Answers

  • I'm pretty sure you can't do this. The Status Bar controls are not accessible via the Object Model. There is a CommandBar object called "Status Bar" but you can't remove the protection from it, and you can't do anything with it while it is protected. The popup is not presented as a standard command bar.
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by cuongdoannhat Thursday, December 22, 2011 10:08 AM
    Monday, September 19, 2011 8:37 AM

All replies

  • hi,
     
    i'm working on version XL2002, i hope this code will work also on xl2010
     
    Sub Add_Commmand_to_AutoCalculate_menu()
    With Application.CommandBars("AutoCalculate").Controls.Add(msoControlButton)
        .Caption = "Say Hello"
        .BeginGroup = True
        .FaceId = 252
        .OnAction = "Hello"
    End With
    End Sub
     
    Sub Hello()
    MsgBox "Hello"
    End Sub
     
    Sub Reset_AutoCalculate_menu()
    Application.CommandBars("AutoCalculate").Reset
    End Sub
     --
    isabelle
     
    Le 2011-09-17 03:37, cuongdoannhat a écrit :
    > In Excel 2010, I want to add a popup menu in the status bar popup menu, how to do?
     
    Saturday, September 17, 2011 2:57 PM
  • Thank Isabelle

    When I replace "AutoCalculate" by the "Status Bar", method 'Add' error, why? Help me



    Sunday, September 18, 2011 4:10 AM
  • hi,
     
    sorry, i don't think there exist a ContextMenus with this name
     
    Sub List_Name_Contextmenus()
        Dim Cbar As CommandBar
        For Each Cbar In Application.CommandBars
            If Cbar.Type = msoBarTypePopup Then
                On Error Resume Next
                i = i + 1
                Cells(i, 1).Value = Cbar.ID
                Cells(i, 2).Value = Cbar.Name
                Cells(i, 3).Value = Cbar.NameLocal
                Cells(i, 4).Value = CbarID
                On Error GoTo 0
            End If
        Next
    End Sub
     
    --
    isabelle
     Le 2011-09-18 00:10, cuongdoannhat a écrit :
    > Thank Isabelle
    >
    > When I replace "AutoCalculate" by the "Status Bar", method 'Add' error, why? Help me
    >
    >
    >
     
    Sunday, September 18, 2011 1:36 PM
  • Thank Isabelle.

    In Excel 2010, when I RClick on the Status Bar, a ContextMenu to appear. So how can code with this ContextMenu? Help me

    Monday, September 19, 2011 4:42 AM
  • hi cuongdoannhat,
     
    i'm sorry for that because i'm working with xl2002 and on this version, a right click on Status Bar or Num Bar, then appears the same "AutoCalculate" ContextMenus
    if it's different in xl2010 you can find the names appear on your context menu, in the list created by this macro
     
    Sub Excel_CommandBars_List()
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    On Error Resume Next
    Sheets("Excel_CommandBar").Delete
    Dim cb As CommandBar
    Worksheets.Add
    ActiveSheet.Name = "Excel_CommandBar"
    [A1] = "ID": [B1] = "Nom Local": [C1] = "VBA name"
    [D1] = "Control ID": [E1] = "Control caption"
    i = 2
        With ActiveSheet
            For Each cb In CommandBars
            For Each c In cb.Controls
            .Cells(i, 1).Value = cb.ID
            .Cells(i, 2).Value = cb.NameLocal
            .Cells(i, 3).Value = cb.Name
            .Cells(i, 4).Value = c.ID
            .Cells(i, 5).Value = c.Caption
            i = i + 1
            Next c
            Next cb
            Range("A:F").Columns.AutoFit
        End With
    Application.DisplayAlerts = True
    Application.ScreenUpdating = True
    End Sub
     
    --
    isabelle
     
    Le 2011-09-19 00:42, cuongdoannhat a écrit :
    > Thank Isabelle.
    >
    > In Excel 2010, when I RClick on the Status Bar, a ContextMenu to appear. So how can codewith this ContextMenu? Help me
    >
     
    Monday, September 19, 2011 5:45 AM
  • Thank Isabelle.

    When running your code on Excel 2010 I get:

    .....

    ID       Nom Local         VBA name       Control ID  Control caption
    445     AutoCalculate    AutoCalculate  2012          &None
    445     AutoCalculate    AutoCalculate  2013          &Average
    445     AutoCalculate    AutoCalculate  2014          &Count
    445     AutoCalculate    AutoCalculate  2015          C&ount Nums
    445     AutoCalculate    AutoCalculate  2016          &Max
    445     AutoCalculate    AutoCalculate  2017          M&in
    445     AutoCalculate    AutoCalculate  2018          &Sum

    ....

    2086   Status Bar        Status Bar       5746          Status Bar
    2099   Ribbon             Ribbon            5746           Ribbon.

    I can not find information on the Status Bar. Does not interfere in the Status Bar?

    Monday, September 19, 2011 6:23 AM
  • when you do a right click on "Status bar" can you tell me what are the names of the controls of this Bar?
    are there only one control on this context menu ?
     
    --
    isabelle
     
    Le 2011-09-19 02:23, cuongdoannhat a écrit :
    > Thank Isabelle.
    >
    > When running your code on Excel 2010 I get:
    >
    > .....
    >
    > ID Nom Local VBA name Control ID Control caption
    > 445 AutoCalculate AutoCalculate 2012 &None
    > 445 AutoCalculate AutoCalculate 2013 &Average
    > 445 AutoCalculate AutoCalculate 2014 &Count
    > 445 AutoCalculate AutoCalculate 2015 C&ount Nums
    > 445 AutoCalculate AutoCalculate 2016 &Max
    > 445 AutoCalculate AutoCalculate 2017 M&in
    > 445 AutoCalculate AutoCalculate 2018 &Sum
    >
    > ....
    >
    > 2086 Status Bar Status Bar 5746 Status Bar
    > 2099 Ribbon Ribbon 5746 Ribbon.
    >
    > I can not find information on the Status Bar. Does not interfere in the Status Bar?
    >
     
    Monday, September 19, 2011 6:39 AM
  • Hi Isabelle.

    Yes, there is only one control as I have mentioned in the list above. With AutoCalculate, that has 7 control.

    Monday, September 19, 2011 8:36 AM
  • I'm pretty sure you can't do this. The Status Bar controls are not accessible via the Object Model. There is a CommandBar object called "Status Bar" but you can't remove the protection from it, and you can't do anything with it while it is protected. The popup is not presented as a standard command bar.
     

    Enjoy,
    Tony
    www.WordArticles.com
    • Marked as answer by cuongdoannhat Thursday, December 22, 2011 10:08 AM
    Monday, September 19, 2011 8:37 AM
  • Thank Tony Jollans. I thought so too but they are true or not.
    Monday, September 19, 2011 8:41 AM