ExcelTip.com
Account Icon Account Icon Account Icon
ExcelTip.com

Go Back   Excel Help Forum > Usenet Groups > Excel 2007 Help

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-28-2008, 10:26 PM
LAF LAF is offline
Registered User
 
Join Date: 19 May 2004
Posts: 63
LAF
Question Customizing the ribbon/menu items.

Our application is currently written using Office XP (Excel 2002). When our tool is run, we modify the menu items (add and remove some of them). For example, we remove some like the ones that allow users to Insert rows.

We also have code to add our own menu items.

In Excel 2007, is there a way using code to disable the menu items and to create our own?

Also, in Excel 2007, is there a way using code to disable/hide some of the options on the ribbons? Also, can we add our own menu items along with ribbon commands? How can this be done using code?
Reply With Quote
  #2  
Old 07-29-2008, 06:43 AM
royUK's Avatar
royUK royUK is offline
Forums Administrator
 
Join Date: 18 Nov 2003
Location: Lincolnshire,UK
Posts: 6,552
royUK will become famous soon enough royUK will become famous soon enough
Customising the Ribbon is not as straightforward as writing VBA code to add or amend menus in earlier versions.

See this

http://www.rondebruin.nl/compatiblemenu.htm
__________________
Hope that helps.

RoyUK
--------
For Excel consulting, free examples and tutorials visit my site
Check out the free Excel Toolbar

New members please read & follow the Forum Rules

Where to copy the code to

Code Tags: Make your code easier for us to read
Reply With Quote
  #3  
Old 07-29-2008, 01:37 PM
michelxld michelxld is offline
Forum Contributor
 
Join Date: 11 Dec 2004
Posts: 114
michelxld is on a distinguished road
Hello,


Quote:
In Excel 2007, is there a way using code to disable/hide some of the options on the ribbons?
You can use XML and VBA code to modify or create custom controls in the Ribbon.


This XML code desactivate "CellFillColorPicker" button :
enabled attribute to false, desactivate the button.

Code:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">

  <commands>
    <!-- desactivate "CellFillColorPicker button" -->
    <command idMso="CellFillColorPicker" enabled="false" />
  </commands>

<ribbon startFromScratch="false">

</ribbon>
</customUI>

Commands parameters have to be placed at the begin of xml file, before the line :
ribbon startFromScratch="boolean".
This action desactivate the button in "TabHome" and mini toolbar (contextual bar).

This is a simple example. there many other options : repurpose commands, conditionnals desactivations ....



Quote:
Also, can we add our own menu items along with ribbon commands? How can this be done using code?
another reference to custom your ribbon :

http://www.oaltd.co.uk/Spreads/Excel...ogRef_ch14.pdf



Regards
michel
Reply With Quote
Reply

Bookmarks

New topics in Excel 2007 Help


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -4. The time now is 12:17 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0