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

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

Notices

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-22-2008, 01:19 PM
LAF LAF is offline
Registered User
 
Join Date: 19 May 2004
Posts: 63
LAF
Ribbon commands in Excel 2007

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 have code like the following.

With CommandBars(1).FindControl(ID:=30006).CommandBar
.FindControl(ID:=30026).Visible = False
.FindControl(ID:=30024).CommandBar.FindControl(ID:=883).Visible = False
.FindControl(ID:=30024).CommandBar.FindControl(ID:=884).Visible = False
.FindControl(ID:=30025).CommandBar.FindControl(ID:=886).Visible = False
.FindControl(ID:=30025).CommandBar.FindControl(ID:=887).Visible = False
.FindControl(ID:=3058).Visible = False
End With

We also have code to add our own menu items like the following:
Set menBidFile = menGGG.Controls.Add(Type:=msoControlPopup, ID:=1)
menBidFile.Caption = "&Bid File"
menBidFile.TooltipText = "Bid File"
menBidFile.BeginGroup = True
sMenuItemAdd menBidFile, "&New", "Create a new bid file", "ThisWorkbook.sBidNew", False, True And (Range("rngViewOnly") <> "Y"), True
sMenuItemAdd menBidFile, "&Edit", "Edit an existing bid file", "ThisWorkbook.sBidEdit", False, True And (Range("rngViewOnly") <> "Y"), True
sMenuItemAdd menBidFile, "&View", "View an existing bid file", "ThisWorkbook.sBidView", False, True, True
sMenuItemAdd menBidFile, "&Save", "Save the current bid file", "ThisWorkbook.sBidSaveFromMenu", True, True, True
sMenuItemAdd menBidFile, "Save Bid &As", "Save bid file using new name", "ThisWorkbook.sBidSaveAs", False, True, True
sMenuItemAdd menBidFile, "&Close", "Close bid but keep GGG open", "Thisworkbook.sBidClose", True, False, True
menBidFile.Enabled = True

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?
  #2  
Old 07-23-2008, 03:30 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
Post locked for failing to use Code Tags.

LAF, you can re-post this using Code Tags and I will delete this one.
__________________
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
Closed Thread

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:21 AM.


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