Closed Thread
Results 1 to 2 of 2

Excel 2007 : Ribbon commands in Excel 2007

  1. #1
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    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. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    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 Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1