none
Usage of CommandBars.Control RRS feed

  • Question

  • Hi,
    I have aprocedure thatcreatesthe contextmenu.Ucommand.OnAction(string),which callsthe macro, I needto find a solutionthat, eg,the calledprocedureassignsparameter.
    In the followingcode,if you make thecontextualmenu, and thenselectvalue "invariably" buttonmacro whichIinsertedintothe active cell"immutably"writtenvalue.I needto change.
    Thegoal istoputthe active cellvalue selectedfrom the contextmenu.I need to havea writtenprocedureso that theOnActioncommandtoinvokeaprocedure thatalwaysputs(other)selected value inthe pop-upmenu.

       With Application.CommandBars.Add(Name:=strMenuName2, 
             With .Controls.Add(Type:=msoControlButton)  ' Vytvoření tlačítek v panelu nástrojů
                .Style = msoButtonIconAndCaption         ' Způsob zobrazení tlačítek
                .Caption = arCapNames(lngCtr)            ' Popisek z datového pole
                .FaceId = 71 + lngCtr                    ' Symbol tlačítek jako pořadové číslo
                .OnAction = "Stav" & (arCapNames)  ' Volané makro "Stav"
     +  název proměnné.   	End With
       End With

    If I have10 variablesarCapNames, Ihave 10macros,asdescribed below.

    Public Sub StavNovy()
      ActiveCell.Value = "Novy"
    End Sub
    Link on example: https://skydrive.live.com/redir?resid=8E14EC6847B5D3A5!133&authkey=!AP_QTKwDHwgIlkQ                                                            

    VALL2

    Wednesday, April 10, 2013 8:51 AM