Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Ribbon's equivalent to CommandBars.ActionControl

With pre-Excel 2007, I could ascertain what user-selection was made
with a custom toolbar menu item using
CommandBars.ActionControl.Index. This menu would be populated from a
worksheet range and knowing the index using this syntax would enable
me to select the cell number from that range.

Now I'm trying to do the equivalent with the Ribbon in Excel 2007. I
can see how to return the control's id property but not the
selection's index. Any suggestions?

Thanks in advance

Paul Martin
Melbourne, Australia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Ribbon's equivalent to CommandBars.ActionControl

OK, here's more on what I'm trying to do:

I have some Menu items I've added to the Ribbon, and each Menu item
has multiple Button items. When I click a Button, I want to be able
to capture that item. Ideally, that'd be its 'index' on the Menu and
also it's description or label. I've been playing around with the
Callbacks, such as getDescription, but I just can't work it out. Any
suggestions are greatly appreciated.

Thanks in advance

Paul Martin
Melbourne, Australia
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Ribbon's equivalent to CommandBars.ActionControl

Hi Paul,

You can use the OnAction call back of the buttons in your menu. The can each
use the same callback routine.
Within the callback routine you can test the control.id or control.tag in
order to determine what was clicked.

I don't think you can read the buttons text. You would need to know that
before hand and some how match it to the controls id.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Paul Martin" wrote in message
...
OK, here's more on what I'm trying to do:

I have some Menu items I've added to the Ribbon, and each Menu item
has multiple Button items. When I click a Button, I want to be able
to capture that item. Ideally, that'd be its 'index' on the Menu and
also it's description or label. I've been playing around with the
Callbacks, such as getDescription, but I just can't work it out. Any
suggestions are greatly appreciated.

Thanks in advance

Paul Martin
Melbourne, Australia


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Ribbon's equivalent to CommandBars.ActionControl

Hmmm, it seems the functionality of these ribbon buttons is somewhat
dumbed down compared to Excel 2003 toolbar controls. In that, I
could, for example, use .Parent.Parent to ascertain which menu item
was selected, and also the selection's index would identify cell had
populated the button's value. I don't find control.id or control.tag
to be particularly useful.

Thanks for your help, Andy.

Paul
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Ribbon's equivalent to CommandBars.ActionControl

As an addendum, I've been playing around with the button's Callbacks.
I thought getDescription might be useful, but I can't work out how it
is used, what it is used for. Can anyone enlighten me?

TIA


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Ribbon's equivalent to CommandBars.ActionControl

If you have not already have a read of Stephen Bullen's chapter on Ribbonx
http://www.oaltd.co.uk/Excel2007ProgRef/Default.htm

The getXXX callbacks are, to me at least, a bit misleading in their name.
The do not get/return anything to you as the programmer. Instead they
get/return information to the Ribbon. So you use it to control the
Description information that the control uses. Rather than as the name
suggests get the description information from the control.

And yes the VBA functionality of the ribbon is limited compared to the
Commandbar object model. That said the ribbon can be much easy to produce
and maintain than commandbar coding *if* you are using controls that already
exist. So to add a fully functioning button to make stuff bold requires only
a reference in the xml to the idMso. Plus creation and destruction of the
ribbon is automatic when the workbook opens and closes. Also when it
activates or deactivates the ribbon controls are automatically
removed/returned.

Cheers
Andy

--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Paul Martin" wrote in message
...
As an addendum, I've been playing around with the button's Callbacks.
I thought getDescription might be useful, but I can't work out how it
is used, what it is used for. Can anyone enlighten me?

TIA


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
How to set off CommandBars hstijnen Excel Programming 1 November 22nd 06 04:54 PM
CommandBars vs CommandBars(1).Controls Sean Excel Programming 3 April 3rd 06 01:34 PM
help --- Commandbars wAyne Excel Programming 5 February 17th 06 08:17 PM
CommandBars defj Excel Programming 2 November 16th 03 12:57 AM


All times are GMT +1. The time now is 11:18 AM.

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

About Us

"It's about Microsoft Excel"