+ Reply to Thread
Results 1 to 3 of 3

comparing commandbars

  1. #1
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    comparing commandbars

    Can someone tell me why this doesn't work?
    Please Login or Register  to view this content.
    but this does work
    Please Login or Register  to view this content.
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

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

    Re: comparing commandbars

    The comparitive IS is a balky one. I only use it to test if somthing IS Nothing. Otherwise, I test a unique property to see if two objects are the same.
    like your name test.

    By the way, why loop? Wouldn't this do the same thing?
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: comparing commandbars

    Hi Mike;

    You're right. In this example, your code would be better.

    But this isn't my real sub. I simplified it for the thread. In reality cbSelected is optional, and if no commandbar is passed then the sub works on all commandbars.

    I use "is" to compare workbooks and worksheets and never had a problem. I would still like to know why it doesn't work with commandbars.

+ 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