Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
custom commandbarPopup control - how to return its identifer?
While you can get the popup's name it's easier just to set a variable to it
like this: Dim MyPopup As CommandBarPopup Set MyPopup = Application.CommandBars("Formatting").Controls.Add (Type:=msoControlPopup, _ Befo=20) MyPopup.Controls.Add msoControlButton 'etc -- Jim "Rich" wrote in message ... | Hello, | | I have recorded macros where I add a NewMenu control to the formatting | toolbar and add some macro buttons. Here is what the recorded macro returns: | --------------------------------------------------------------------------------------- | Application.CommandBars("Formatting").Controls.Add Type:=msoControlPopup, _ | Befo=20 | Application.CommandBars("Custom Popup 86682718").Controls.Add Type:= _ | msoControlButton, ID:=2950, Befo=1 | Application.CommandBars("Custom Popup 86682718").Controls.Add Type:= _ | msoControlButton, ID:=2950, Befo=2 | -------------------------------------------------------------------------------------- | | I want to duplicate this using VBA code, but I have no idea how to retrieve | this identifier "Custom Popup 86682718". If I record another macro where I | add another NewMenu Item it comes up with a different identifier like | | CommandBars("Custom Popup 13514682").... | | how can I retrieve this identifier? I have tried | | Dim cb As CommandBar, ctl As CommandBarControl | Set cb = CommandBars("Formatting") | For Each ctl In cb.Controls | Debug.print ctl.Caption & " " & ctl.ID & " " & ctl.Index | Next | | But nothing returns the identifier for the control. How can this identifier | be returned/retrieved? | | Thanks, | Rich | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Custom control event problem | Excel Programming | |||
Custom Checkbox control in Excel | Excel Programming | |||
How to trap the OnAction of a CommandBarPopup | Excel Programming | |||
focus on commandbarPopup | Excel Programming | |||
Create Custom Control thru Code? | Excel Programming |