![]() |
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 |
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 |
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 ================================================ |
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 |
All times are GMT +1. The time now is 09:57 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com