+ Reply to Thread
Results 1 to 3 of 3

Customed Context Menu

  1. #1
    Registered User
    Join Date
    02-20-2014
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    36

    Customed Context Menu

    Hello,

    I'd like to customize the Application.CommandBars("Cell") in the following way:

    - Delete all buttons
    - Add my own buttons

    The problem is after deleting everything, the line "ContextMenu.Controls.Add(Type:=msoControlButton, before:=1)" doesn't work anymore.
    Given the fact that there is no button anymore, the macro does not understand the "before:=1".

    How can I add a first button after deleting everything ?

    Thanks

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Customed Context Menu

    Try entering the line

    Please Login or Register  to view this content.
    Add your button

    Please Login or Register  to view this content.
    try adding your button using 1 or (1) instead of "Before:- 1"

    Because you disabled alerts Excel should work.

  3. #3
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Customed Context Menu

    Actually
    Please Login or Register  to view this content.
    does not disable alerts, excel will simply continue with the next line doing nothing in case of error.

    begin should be optional, remove it and try the code
    If you are pleased with a member's answer then use the Star icon to rate it.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Context Menu within the VBE
    By Steel Monkey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2007, 07:18 PM
  2. Context menu
    By cmpcwil2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2006, 07:11 AM
  3. Add items to context menu
    By Fred Jacobowitz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-22-2006, 05:35 PM
  4. [SOLVED] Context menu of Cell
    By MadDog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2006, 06:35 AM
  5. Context Menu
    By nrussell in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-29-2005, 05:08 AM

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