+ Reply to Thread
Results 1 to 4 of 4

Remove all occurences of a command bar button

  1. #1
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253

    Remove all occurences of a command bar button

    Since I am still learning VBA, I sometimes my poor VBA creates too many command bar buttons that are identical when going between workbooks.

    Can someone provide better VBA that will get rid of all occurances?

    I have been using the following but hope there is something a little better to assure that all occurances of a particular command bar button is removed:

    Please Login or Register  to view this content.
    Thanks for your help. mikeburg
    Last edited by mikeburg; 01-31-2010 at 05:11 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Remove all occourances of a command bar button

    Hello Mike,

    It would help to see your workbook, since there are several variables that affect which solution should be used.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Remove all occourances of a command bar button

    The general technique that I use is that immediatly before creating a command bar or a command bar control, I delete it (buffered by On Error Resume Next..Goto 0), or at least try to. That way there is never a duplicate.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  4. #4
    Forum Contributor
    Join Date
    06-23-2005
    Posts
    253

    Re: Remove all occourances of a command bar button

    That will work. Thanks a lot. mikeburg

+ Reply to 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