Warning: Cannot modify header information - headers already sent by (output started at /home/excel13/public_html/blog/wp-content/themes/cordobo-green-park-09-beta-09/functions.php:2) in /home/excel13/public_html/blog/wp-includes/feed-rss2-comments.php on line 8
Comments on: Creating a Dynamic Menu – An Example http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/ More geeky stuff from the author of www.excelguru.ca... Mon, 31 Oct 2011 15:51:25 +0000 hourly 1 http://wordpress.org/?v=3.3.1 By: Ken Puls http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-176506 Ken Puls Tue, 23 Nov 2010 17:44:00 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-176506 Hi Peter, I tried to repro your issue using an add-in I have on my side that creates RibbonX to display file and folder paths, and came up with an interesting result. I first created a test folder in the directory and made about 10 copies of it.. eg Test 1 - Copy (2) to Test 1 - Copy(9) The dynamic menu returned nothing. I then figured that I would try and find exactly how many I could fit, so created new ones... eg Test 1, Test 2, etc... This time my menu worked just fine and scrolled off the bottom of the screen. After doing some digging it turns out that in my setup, having a folder that contains the ( character causes an error in the XML. I haven't looked to find out why. I was able to create a menu that scrolled of the screen though, (about 40 items in total) without any issue. How many items were you trying to load in? Hi Peter,

I tried to repro your issue using an add-in I have on my side that creates RibbonX to display file and folder paths, and came up with an interesting result.

I first created a test folder in the directory and made about 10 copies of it.. eg Test 1 – Copy (2) to Test 1 – Copy(9)

The dynamic menu returned nothing. I then figured that I would try and find exactly how many I could fit, so created new ones… eg Test 1, Test 2, etc… This time my menu worked just fine and scrolled off the bottom of the screen.

After doing some digging it turns out that in my setup, having a folder that contains the ( character causes an error in the XML. I haven’t looked to find out why.

I was able to create a menu that scrolled of the screen though, (about 40 items in total) without any issue. How many items were you trying to load in?

]]>
By: Peter http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-176505 Peter Tue, 23 Nov 2010 11:21:05 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-176505 I have been experimenting with this code and it works, except if my list becomes too long. it looks like VBA just disregards the string and does not even read the cause the dynamic menu is just empty. Can I create long drop down menus with a scrollbar or is this not possible? tx I have been experimenting with this code and it works, except if my list becomes too long.

it looks like VBA just disregards the string and does not even read the cause the dynamic menu is just empty.

Can I create long drop down menus with a scrollbar or is this not possible?

tx

]]>
By: Mehmet http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-176186 Mehmet Fri, 04 Jun 2010 15:32:14 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-176186 Sorry! Just realised that getLabel, etc. are valid in Tabs and Groups: id="MyGroup" getLabel="MySheet.GetLabel" getScreentip="MySheet.GetScreentip" getSupertip="MySheet.GetSupertip" Sorry!
Just realised that getLabel, etc. are valid in Tabs and Groups:

id=”MyGroup”
getLabel=”MySheet.GetLabel”
getScreentip=”MySheet.GetScreentip”
getSupertip=”MySheet.GetSupertip”

]]>
By: Ken Puls http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-176185 Ken Puls Fri, 04 Jun 2010 15:28:13 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-176185 Hi Mehmet, Yes, absolutely. You can use the getLabel callback for the tabs, which allows you to feed them content dynamically. It's not nearly as complicated as the dynamicMenu though. Have you got the RibbonX book? There is an example of setting up a Multi-Lingual UI on pages 455-458. Hi Mehmet,

Yes, absolutely. You can use the getLabel callback for the tabs, which allows you to feed them content dynamically. It’s not nearly as complicated as the dynamicMenu though.

Have you got the RibbonX book? There is an example of setting up a Multi-Lingual UI on pages 455-458.

]]>
By: Mehmet http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-176183 Mehmet Fri, 04 Jun 2010 13:22:47 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-176183 Hi Ken, I have a question similar to Brian's #3. Thera are two hard-coded labels in the XML: label="My Testing Tab" label="My Menu" Is there any way to change these during run time? I simply wish to create a multi-lingual menu system where all lables are re-defined during run time. Regards, Mehmet Hi Ken,
I have a question similar to Brian’s #3.
Thera are two hard-coded labels in the XML:
label=”My Testing Tab”
label=”My Menu”
Is there any way to change these during run time?
I simply wish to create a multi-lingual menu system where all lables are re-defined during run time.
Regards, Mehmet

]]>
By: Ken Puls http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-176113 Ken Puls Fri, 19 Mar 2010 03:58:12 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-176113 Hi Charles, Since the dynamicmenu callback essentially just creates the appropriate XML on the fly I don't see any reason why you couldn't have your callback insert the XML to create a new dynamic menu as a submenu insted of a button. You'd just need to write the vba to make it happen. Hi Charles,

Since the dynamicmenu callback essentially just creates the appropriate XML on the fly I don’t see any reason why you couldn’t have your callback insert the XML to create a new dynamic menu as a submenu insted of a button. You’d just need to write the vba to make it happen.

]]>
By: Charles http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-176110 Charles Wed, 17 Mar 2010 20:40:09 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-176110 Between your blog and "RibbonX Customizing the Office 2007 Ribbon" I have been able to do much of what I was hoping to do. So let me say "thanks" first of all. However, I am spinning my wheels on one point. I have a few dynamic menus that read from system folders that work fine. What I would like to do is have a dynamic submenu that refers to subfolders. Can this be handled from the call back side where XML is generated in the VBA code (similar to the example in ch 9) or does this need to be handled in the XML that gets zipped into .xlsm file? Can it be handled? Any code or advice would be much appreciated. Between your blog and “RibbonX Customizing the Office 2007 Ribbon” I have been able to do much of what I was hoping to do. So let me say “thanks” first of all. However, I am spinning my wheels on one point. I have a few dynamic menus that read from system folders that work fine. What I would like to do is have a dynamic submenu that refers to subfolders. Can this be handled from the call back side where XML is generated in the VBA code (similar to the example in ch 9) or does this need to be handled in the XML that gets zipped into .xlsm file? Can it be handled? Any code or advice would be much appreciated.

]]>
By: Ken Puls http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-158009 Ken Puls Wed, 17 Jun 2009 04:15:33 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-158009 Hi Brian, Re #1: I agree, that's irritating. I don't recall that it always did that, but I'm wondering if the behaviour changed with a service pack as I also see that with some of my add-ins now. I haven't had the time to dig into it deeply yet. Re #2: Yup. Once you lose the ribbon object, it's over and you can't get it back unless you re-open the workbook. I REALLY hope this gets fixed in Office 2010. With regards to your last point, that would be a great feature. Unfortunately there is no way to do it at this time. I'm also hoping that we see something to solve this in Office 2010, but I don't know that I'd bet much on it. Hi Brian,

Re #1: I agree, that’s irritating. I don’t recall that it always did that, but I’m wondering if the behaviour changed with a service pack as I also see that with some of my add-ins now. I haven’t had the time to dig into it deeply yet.

Re #2: Yup. Once you lose the ribbon object, it’s over and you can’t get it back unless you re-open the workbook. I REALLY hope this gets fixed in Office 2010.

With regards to your last point, that would be a great feature. Unfortunately there is no way to do it at this time. I’m also hoping that we see something to solve this in Office 2010, but I don’t know that I’d bet much on it.

]]>
By: Brian http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-157923 Brian Tue, 16 Jun 2009 14:29:04 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-157923 Ken: I've tried using the dynamicMenu approach, but have discovered two things that don't work so well: - When you click the menu item, you don't see the buttons underneath until the NEXT time you click it. - Worse, when you lose the reference to the ribbon object, the getContent no longer works. Is there a way to form the entire XML menu code via VBA during the startup of the add-in, then load it, rather than loading a "skeleton" XML menu structure with dynamic menus and updating it in that way? FYI, I have an application that creates command bars and buttons based on database values -- so it wouldn't work for us to create a single "static" XML menu structure -- and I'd love to create an equivalent ribbon for our 2007 users. The bars/buttons don't have to change after the add-in is loaded, so the complexity in creating the menus is only limited to the startup of the add-in. Ken:

I’ve tried using the dynamicMenu approach, but have discovered two things that don’t work so well:
- When you click the menu item, you don’t see the buttons underneath until the NEXT time you click it.
- Worse, when you lose the reference to the ribbon object, the getContent no longer works.

Is there a way to form the entire XML menu code via VBA during the startup of the add-in, then load it, rather than loading a “skeleton” XML menu structure with dynamic menus and updating it in that way? FYI, I have an application that creates command bars and buttons based on database values — so it wouldn’t work for us to create a single “static” XML menu structure — and I’d love to create an equivalent ribbon for our 2007 users. The bars/buttons don’t have to change after the add-in is loaded, so the complexity in creating the menus is only limited to the startup of the add-in.

]]>
By: Bren http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/comment-page-1/#comment-100166 Bren Wed, 20 Aug 2008 15:12:21 +0000 http://www.excelguru.ca/blog/2007/01/09/creating-a-dynamic-menu-an-example/#comment-100166 Further to my comment above, it's actually when no workbook that is open that the getVisible and getEnabled functions run really, really slow. Is there any solution to this? Further to my comment above, it’s actually when no workbook that is open that the getVisible and getEnabled functions run really, really slow.

Is there any solution to this?

]]>