+ Reply to Thread
Results 1 to 6 of 6

Can't delete custom menu group created in VBA

  1. #1
    Registered User
    Join Date
    06-29-2020
    Location
    Nottingham
    MS-Off Ver
    365
    Posts
    2

    Exclamation Can't delete custom menu group created in VBA

    Hi,

    I created a custom menu in vba using this command line:

    Set KeepaButton = Application.CommandBars("Tools").Controls.Add(Type:=msoControlButton)

    I cannot get rid of the now empty menu group "Menu Commands" now being displayed on the Add-Ins tool bar and it is driving me crazy, I could right click the menu item and delete, which I did!

    MenuCommands.png

    I have tried to sort it through Customize Ribbon, but the Menu Commands item is greyed out along with the Remove button.

    customizeribbon.png

    I am assuming I will have to do this programmaticaly, but I can't see how!

    I would really appreciate some help!!!

    Thanks you!

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Can't delete custom menu group created in VBA

    What is the actual name of the control you added?
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475

    Re: Can't delete custom menu group created in VBA

    Wherever you found the code to add the group, you should be able to find the code to delete the group.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Can't delete custom menu group created in VBA

    My guess would be that you didn't set the .Caption property on your custom menu item, thus you can probably find it because it is the only one without a caption... Thus not truly "empty". Thats just a theory... but if you did that (not giving it a caption) even once, then it would behave this way. I tried running your one line of code to add and got an empty menu just like you, and the below fixes that.

    Please Login or Register  to view this content.
    Last edited by Arkadi; 06-29-2020 at 01:21 PM.

  5. #5
    Registered User
    Join Date
    06-29-2020
    Location
    Nottingham
    MS-Off Ver
    365
    Posts
    2

    Re: Can't delete custom menu group created in VBA

    You are a star! Thank you so much. That worked! :-)

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Can't delete custom menu group created in VBA

    Glad to hear it AngieJD! Thanks for marking the thread as solved, and the feedback

+ 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. [SOLVED] Losing a custom menu bar within Windows menu bar when new excel session is opened.
    By SCACCHIA in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-17-2014, 04:34 PM
  2. [SOLVED] Trying to 'Grey Out' menu items on Custom Menu if Workbook is ReadOnly
    By TC1980 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-30-2013, 08:22 AM
  3. Delete empty cells and custom sort by group?
    By iturnrocks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2008, 03:19 PM
  4. [SOLVED] how to permantly delete a custom menu in excel
    By lostwings in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-02-2006, 05:30 PM
  5. [SOLVED] Add menuitems to custom created menu
    By René in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2006, 10:40 AM
  6. [SOLVED] how to delete custom menu in excel?
    By helai in forum Excel General
    Replies: 4
    Last Post: 09-01-2005, 09:05 AM
  7. [SOLVED] How to delete Custom VBA Menu
    By Jeff in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2005, 11:06 PM

Tags for this Thread

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