1 Attachment(s)
Activate Ribbon Tab In Excel 2007 2010 *
One can access the Ribbon by using Commandbars("Ribbon") that will return an IAccessible object. You can access the tabs using the oleacc.dll library which can return an array of other IAccessible objects which are basically the list of all child elements. So the first child of the ribbon would be its tab. Using the IDs (which are strings) of these children objects you can filter in to the next child level which can be menu items etc.
Credit to Tony Jollans, Microsoft Word MVP for the ribbon demo that you can find at www.WordArticles.com
Here you can download a working example of how to activate a tab in either 2007 or 2010 versions of Excel. Note, for Excel 2010, MS has already incorporated the ActivateTab and ActivateTabMso methods, so one doesn't have to worry about elaborate codes to get the job done. The XML code used is given below
PHP Code:
<customUI onLoad="OLUIR" xmlns=http://schemas.microsoft.com/office/2006/01/customui>
<ribbon>
<tabs>
<tab id="tabAUniqueNameIDForMyNewTab" label="My New Tab" insertAfterMso="TabView">
</tab>
</tabs>
</ribbon>
</customUI>
I can't seem to make this work with the "Add-In" tab
1 Attachment(s)
I still can't seem to make it work
I've attached my sample project. It has a menu which shows on the add-ins tab. With your code, I can't seem to give focus to it. I'm sure I missing something easy.
1 Attachment(s)
This example does not work in Excel 2007
Hello,
Attachment 5091
This is the example that I tried in Excel 2007.
You asked me to start a new thread but the button to do so is not available. According to manual I do not have the rights probably. I have registered.
If you open the example it creates the custom tab but gets an error 91 because the ReturnElement has value Nothing and cannnot call its method. In my opinion this is caused because GetAccessible does not find the custom tab in the control tree.
Can you look into this example in spite of the fact that I did not create a new Thread?
Thanks
Rob Kemper