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: Modifying the Ribbon – Part 8 http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/ 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/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-90465 Ken Puls Sat, 12 Jul 2008 06:31:08 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-90465 Sujith, You're correct in that the way you mentioned works in 2003, and also that your toolbar will manifest in the add-ins tab in 2007. The bad news... you can't do this using VBA alone. The easiest way to do what you are after is to save the file as an xlam, create XML code to set the startFromScratch attribute to true, and specifically declare tab idMso="TabAddIns" visible="true" Any way you slice it, though, you'll need to write some XML. Hope that helps, Ken Sujith,

You’re correct in that the way you mentioned works in 2003, and also that your toolbar will manifest in the add-ins tab in 2007.

The bad news… you can’t do this using VBA alone. The easiest way to do what you are after is to save the file as an xlam, create XML code to set the startFromScratch attribute to true, and specifically declare tab idMso=”TabAddIns” visible=”true”

Any way you slice it, though, you’ll need to write some XML.

Hope that helps,

Ken

]]>
By: sujith http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-90096 sujith Fri, 11 Jul 2008 06:43:54 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-90096 I would like to know how to disable/hide each tab in ribbons except the Add-ins tab. My custom toolbar is in Add-ins Tab.This should be done through macro code. In excel 2003, we used to do this with the following code Dim c as commandbar For each c in application.commandbars c.enabled=false next Please help. I would like to know how to disable/hide each tab in ribbons except the Add-ins tab. My custom toolbar is in Add-ins Tab.This should be done through macro code.
In excel 2003, we used to do this with the following code

Dim c as commandbar
For each c in application.commandbars
c.enabled=false
next

Please help.

]]>
By: Ken Puls http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-68251 Ken Puls Tue, 29 Apr 2008 03:58:01 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-68251 Hi Kevin, Out of curiosity, is the Add-in loaded when you open the document in this way? Hi Kevin,

Out of curiosity, is the Add-in loaded when you open the document in this way?

]]>
By: Kevin http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-67351 Kevin Fri, 25 Apr 2008 18:29:06 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-67351 Hi, So, I have an add-in in which I updated xml with a customUI. This menu loads when I start up excel, but if I open a specific workbook direct from my documents, the menu doesn't load. Any help would be great! KML Hi,

So, I have an add-in in which I updated xml with a customUI. This menu loads when I start up excel, but if I open a specific workbook direct from my documents, the menu doesn’t load.

Any help would be great!

KML

]]>
By: Ken Puls http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-66471 Ken Puls Mon, 21 Apr 2008 17:55:39 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-66471 Hi Robert, Unfortunately, no. This is the single biggest issue that we have when creating building and debugging ribbon modifications. I'm hoping that we'll see this ability in Office 14, but only time will tell. Right now, if you lose your RibbonUI object, the only recourse is to reload the workbook/addin to reset it. It's a one shot deal. Hi Robert,

Unfortunately, no. This is the single biggest issue that we have when creating building and debugging ribbon modifications. I’m hoping that we’ll see this ability in Office 14, but only time will tell.

Right now, if you lose your RibbonUI object, the only recourse is to reload the workbook/addin to reset it. It’s a one shot deal.

]]>
By: Robert Paulsen http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-66450 Robert Paulsen Mon, 21 Apr 2008 16:32:49 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-66450 Can you reset the IRibbonUI global variable? In one of your examples you had the following code: Dim cRibbon as IRibbonUI Private Sub sbCustomUI_onLoad(ribbon as IRibbonUI) Set cRibbon=ribbon End Sub If cRibbon gets set to Nothing is there a way to reset it? Can you reset the IRibbonUI global variable?

In one of your examples you had the following code:
Dim cRibbon as IRibbonUI

Private Sub sbCustomUI_onLoad(ribbon as IRibbonUI)
Set cRibbon=ribbon
End Sub

If cRibbon gets set to Nothing is there a way to reset it?

]]>
By: Ray R. Gable, Jr. http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-26094 Ray R. Gable, Jr. Thu, 23 Aug 2007 21:10:51 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-26094 An example of is provided at http://www.oaltd.co.uk/Spreads/Excel2007VBAProgRef_ch14.pdf (pg. 309 - Updating Controls at Run Time). Essentially, the GetContent procedure can be called each time the menu is clicked by calling the InvalidateControl method of the iRibbonUI interface. Based on the example above, there are 3 changes which need to be made to have the menu dynamically populated when clicked: Step 1: In the Microsoft Office 2007 CustomUI Editor, tell Excel to give you an iRibbonUI interface by adding the onLoad callback to the customUI element to the XML: Step 2: In the VBA module, create a global variable which will be used to invalidate the menu. The variable will be initialized when the workbook is opened/XML loaded. Dim cRibbon as IRibbonUI Private Sub sbCustomUI_onLoad(ribbon as IRibbonUI) Set cRibbon=Ribbon End Sub Step 3: Add the following line of code at the end of the GetContent procedure to dynamically rebuild the menu each time it's clicked: cRibbon.InvalidateControl "menu1" Hope this helps, Ray R. Gable, Jr. An example of is provided at http://www.oaltd.co.uk/Spreads/Excel2007VBAProgRef_ch14.pdf (pg. 309 – Updating Controls at Run Time).

Essentially, the GetContent procedure can be called each time the menu is clicked by calling the InvalidateControl method of the iRibbonUI interface.

Based on the example above, there are 3 changes which need to be made to have the menu dynamically populated when clicked:

Step 1:
In the Microsoft Office 2007 CustomUI Editor, tell Excel to give you an iRibbonUI interface by adding the onLoad callback to the customUI element to the XML:

Step 2:
In the VBA module, create a global variable which will be used to invalidate the menu. The variable will be initialized when the workbook is opened/XML loaded.

Dim cRibbon as IRibbonUI

Private Sub sbCustomUI_onLoad(ribbon as IRibbonUI)
Set cRibbon=Ribbon
End Sub

Step 3:
Add the following line of code at the end of the GetContent procedure to dynamically rebuild the menu each time it’s clicked:

cRibbon.InvalidateControl “menu1″

Hope this helps,

Ray R. Gable, Jr.

]]>
By: Goran http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-10750 Goran Tue, 15 May 2007 09:47:35 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-10750 A very good guide in dynamic menus. Exactly what I've been looking for!! BUT... Is there a way to reset the dynamic menu? The first time you open the dynamic menu, the GetContent-procedure is called. But only once. Next time when I open the menu the procedure is not called since the dynamic menu is already populated. I would like to call the GetContent procedure each time i open the menu. Is that possible? A very good guide in dynamic menus. Exactly what I’ve been looking for!!

BUT… Is there a way to reset the dynamic menu? The first time you open the dynamic menu, the GetContent-procedure is called. But only once. Next time when I open the menu the procedure is not called since the dynamic menu is already populated.

I would like to call the GetContent procedure each time i open the menu. Is that possible?

]]>
By: tom http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-5630 tom Mon, 09 Apr 2007 16:48:25 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-5630 I am trying to run the code to create a menu in Microsoft Access but keep getting an error "Microsoft Office can't run the macro or callback function 'GetContent'. I am trying to run the code to create a menu in Microsoft Access but keep getting an error “Microsoft Office can’t run the macro or callback function ‘GetContent’.

]]>
By: Ken Puls http://www.excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/comment-page-1/#comment-433 Ken Puls Sun, 04 Feb 2007 17:38:17 +0000 http://excelguru.ca/blog/2006/12/02/modifying-the-ribbon-part-8/#comment-433 Hi Mario, My blog has issues with displaying XML. Can you email that to me? (You can send me the workbook if you like as well.) Email is ken at excelguru dot ca Thanks, Ken Hi Mario,

My blog has issues with displaying XML. Can you email that to me? (You can send me the workbook if you like as well.)

Email is ken at excelguru dot ca

Thanks,

Ken

]]>