Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Add button on existing Excel 2007 ribbon (Read 10871 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Add button on existing Excel 2007 ribbon
06.10.09 at 12:52:50
 
Add button on existing Excel 2007 ribbon
 
Through XML you can add your own buttons to the Excel 2007 ribbon interface. It is easiest to use the Office 2007 Custom UI Editor.  
 
First, create a new blank Excel document and save it e.g. as book1.xlsx.
Then open it in the Office 2007 UI Editor.
Add the XML and save the file.
Open the .xlsx file in Excel. Excel will interpret the XML and display the new button.
 
Example 1:
A new button "Click Me" in a new group MyGroup in the home tab:
Code:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonOnLoad">
 <ribbon>
  <tabs>
	<tab idMso="TabHome" >
	 <group id="MyGroup" label="MyGroup">	 
	 <button id="MyBtn" label="Click Me" size="large" />
	 </group>
	</tab>
  </tabs>
 </ribbon>
</customUI> 


 
Example 2:
Add a new button "Click Me" to the end of the Office Menu.
Code:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonOnLoad">
 <ribbon>
  <officeMenu>
	<button id="MyBtn" label="Click Me" />
  </officeMenu>
 </ribbon>
</customUI>
 


 
Example 3:
Add a new button "Click Me" to the Office Menu just after the File Save button.
Code:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="RibbonOnLoad">
 <ribbon>
  <officeMenu>
	<button id="MyBtn" label="Click Me" insertAfterMso="FileSave"/>
  </officeMenu>
 </ribbon>
</customUI> 

Back to top
 
« Last Edit: 22.02.10 at 13:43:37 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
idMso Excel control id's
Reply #1 - 06.10.09 at 12:59:58
 
idMso Excel control id's
 
Tab Names:
Office Menu
TabHome
TabInsert
TabPageLayoutExcel
TabFormulas
TabData
TabReview
TabView
TabDeveloper
TabAddIns
TabPrintPreview
None (Not in the Ribbon)
TabSmartArtToolsDesign
TabSmartArtToolsFormat
TabChartToolsDesign
TabChartToolsLayout
TabChartToolsFormat
TabDrawingToolsFormat
TabPictureToolsFormat
TabPivotTableToolsOptions
TabPivotTableToolsDesign
TabHeaderAndFooterToolsDesign
TabTableToolsDesignExcel
TabPivotChartToolsDesign
TabPivotChartToolsLayout
TabPivotChartToolsFormat
TabPivotChartToolsAnalyze
TabInkToolsPens
 
 
 
 
Source:
2007 Office System Document: Lists of Control IDs
http://www.microsoft.com/downloads/details.aspx?familyid=4329d9e9-4d11-46a5-898d -23e4f331e9ae&displaylang=en
Back to top
 
« Last Edit: 06.10.09 at 13:02:13 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Remove the Excel 2007 ribbon
Reply #2 - 12.01.10 at 10:24:21
 
Remove the Excel 2007 ribbon
 
To completely remove the Excel 2007 ribbon you can use the following XML in the GetCustomUI function.
 
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
 <ribbon startFromScratch="true">
 </ribbon>
</customUI>
Back to top
 
« Last Edit: 12.01.10 at 10:33:13 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Excel 2010 ribbon XML
Reply #3 - 23.08.10 at 14:34:49
 
Excel 2010 ribbon XML
 
In Excel 2010 / Office 2010, the ribbon XML changed somewhat.  
 
 
See:
http://msdn.microsoft.com/en-us/library/dd910855%28v=office.12%29.aspx
Back to top
 
 

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1