Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom control event problem [email protected] Excel Programming 1 November 8th 06 12:41 AM
Custom Checkbox control in Excel Jim[_9_] Excel Programming 2 March 7th 06 03:34 PM
How to trap the OnAction of a CommandBarPopup R Avery Excel Programming 3 October 28th 04 08:06 PM
focus on commandbarPopup vivek Excel Programming 0 January 12th 04 07:02 PM
Create Custom Control thru Code? Greg Bloom Excel Programming 1 October 13th 03 09:21 PM


All times are GMT +1. The time now is 09:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"