Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Excel 2007: getItemLabel not working

Hi guys

Based on Jim Rech's dynamic dropdown in Excel 2007, sourced from Andy
Pope's page on the Ribbon, I'm trying to populate a dropdown at
Workbook open. It doesn't really need to be as dynamic as Jim's
example (updates as the list changes). For some reason I can't seem
to get it to work. This is what I have done:

* In XML, I've defined onLoad to run RibbonOnLoad in VBA.
RibbonOnLoad captures the ribbon as a variable.
* In XML, the dropdown's getItemLabel calls GetDropdownList in VBA
* In VBA RefreshRibbon invalidates the ribbon.
* When I invalidate the ribbon (even when manually running
RefreshRibbon), GetDropdownList is not being called.

Can anyone please suggest what I might be doing wrong or what else I
need to do. From Jim Rech's example, I can't see what's wrong.

Thanks in advance

Paul Martin
Melbourne, Australia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Excel 2007: getItemLabel not working

Hi Paul

I have two examples on my site
http://www.rondebruin.nl/ribbon.htm

See point 3 : download Dropdown.zip


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Paul Martin" wrote in message ...
Hi guys

Based on Jim Rech's dynamic dropdown in Excel 2007, sourced from Andy
Pope's page on the Ribbon, I'm trying to populate a dropdown at
Workbook open. It doesn't really need to be as dynamic as Jim's
example (updates as the list changes). For some reason I can't seem
to get it to work. This is what I have done:

* In XML, I've defined onLoad to run RibbonOnLoad in VBA.
RibbonOnLoad captures the ribbon as a variable.
* In XML, the dropdown's getItemLabel calls GetDropdownList in VBA
* In VBA RefreshRibbon invalidates the ribbon.
* When I invalidate the ribbon (even when manually running
RefreshRibbon), GetDropdownList is not being called.

Can anyone please suggest what I might be doing wrong or what else I
need to do. From Jim Rech's example, I can't see what's wrong.

Thanks in advance

Paul Martin
Melbourne, Australia

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Excel 2007: getItemLabel not working

Oops, I said Andy's page, but actually it was yours, Ron. Pardon moi.

So yes, I'm looking at your code and understand it, but don't seem to
be able to replicate it. FWIW, extracts from the XML and VBA are
below. I'm sure it will look familiar to you.

================================================

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/
customui"
onLoad="RibbonOnLoad"
<ribbon
<tabs

<tab id="Production"
label="Production"

<group id="ReportFilters"
label="Report Filters"

<dropDown id="Quarter"
label="Quarter"
getItemLabel="GetDropdownList"
getSelectedItemIndex="GetSelectedItemIndex"
onAction="DropdownOnAction"/

.....

================================================

Dim Rib As IRibbonUI

Public Sub RibbonOnLoad(Ribbon As IRibbonUI)
Set Rib = Ribbon
End Sub

Public Sub RefreshRibbon()
Rib.Invalidate
End Sub

Sub GetDropdownList(control As IRibbonControl, index As Integer, ByRef
DropdownItem)
DropdownItem = Range("ListQuarters").Columns(1).Cells(index +
1).Value
End Sub

================================================
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Excel 2007: getItemLabel not working

Ron, I've worked it out. I didn't think I needed getItemCount, but
that was the only difference I could ascertain between your code and
mine, and implementing that has worked.

Thanks for your prompt response

Paul
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
F2 Key not working in Excel 2007 JodieM Excel Discussion (Misc queries) 2 November 18th 10 08:21 PM
Formuls not working (Excel 2007) pgarcia Excel Discussion (Misc queries) 2 December 2nd 08 03:50 PM
Excel 2007 Macro Help (Excel 2003 not working in 2007) Pman Excel Discussion (Misc queries) 4 May 29th 08 06:29 PM
Formula not working in excel 2007 Rao Ratan Singh Excel Discussion (Misc queries) 3 January 2nd 08 02:47 PM
a defined name not working in Excel 2007 Bumbrlik Excel Programming 3 August 27th 07 02:48 AM


All times are GMT +1. The time now is 11:39 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"