Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
F2 Key not working in Excel 2007 | Excel Discussion (Misc queries) | |||
Formuls not working (Excel 2007) | Excel Discussion (Misc queries) | |||
Excel 2007 Macro Help (Excel 2003 not working in 2007) | Excel Discussion (Misc queries) | |||
Formula not working in excel 2007 | Excel Discussion (Misc queries) | |||
a defined name not working in Excel 2007 | Excel Programming |