+ Reply to Thread
Results 1 to 8 of 8

UserForm Control disappeared

  1. #1
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    UserForm Control disappeared

    I have some odd behavior occuring with my UserForm.

    I had inserted a ListBox into the UserForm, and I was re-positioning the control when...I don't know what happened...my finger slipped off the mouse, or something. But, the ListBox simply VANISHED!!

    No problem, right?? I simply grabbed and inserted another control.
    The NEW control is listed in the UserForm Properties as ListBox2...!!!
    ListBox1 is NOWHERE TO BE FOUND...!!!
    It's not listed in the UserForm Properties...(ListBox2 is there).
    It's not visible on the UserForm, itself...(ListBox2 is).
    I even looked in the Tab Order for the UserForm...again, ListBox2, but no ListBox1.

    And get this...If I try to RENAME ListBox2 to ListBox1, I get an "ambiguous name" error.

    Here's why this is a problem...

    I have lots of Macros or Event Procedures written to perform actions with the items found in ListBox1 on all of my UserForms. I will have to re-write all of that code to make it work with this UserForm...

    Or, I can re-build the UserForm from scratch...which is probably what I will end up doing.

    So...here's my questions:

    Does anybody have any idea what happened, here??
    Have you ever experienced this before??
    And, if so...do you know how to fix it without scrapping the UserForm??

    I spent a while searching for the solution on the internet...and couldn't even find anyone that had experienced a similar situation.

    Any insight would be greatly appreciated.
    Last edited by HuskerBronco; 06-27-2011 at 10:33 AM. Reason: solved

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: UserForm Control disappeared

    Can you attach the workbook?

    If the worst comes to the worst you can quickly amend the codes by using Find & Replace ListBox1 for ListBox2
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: UserForm Control disappeared

    You could try running a quick macro to delete ListBox1:
    Please Login or Register  to view this content.
    If this runs without any errors then it will have deleted ListBox1 and you can try renaming ListBox2 again. If you get an error then the macro can't find a shape called ListBox1 either.

    Alternatively, can you copy everything (except the controls) into a new workbook and add them again from scratch?
    Last edited by Kafrin; 06-27-2011 at 08:59 AM.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,332

    Re: UserForm Control disappeared

    Do you have any frame controls or multipages on the form?
    Everyone who confuses correlation and causation ends up dead.

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

    Re: UserForm Control disappeared

    Rename the control currently named ListBox2 to have the name ListBox1, using the Properties window.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Re: UserForm Control disappeared

    Quote Originally Posted by royUK View Post
    If the worst comes to the worst you can quickly amend the codes by using Find & Replace ListBox1 for ListBox2
    I was about ready to do just that, royUK...but then I got to thinking, "There's GOT to be a better way!!".
    Most of the code is in my Personal.XLSB workbook, and it can't be changed or it won't work for other projects.
    I even considered putting the amended code in a module JUST to handle this specific UserForm.
    What I was hoping to find, was a way to delete this "invisible" control with a Macro...like Kafrin suggested:
    Quote Originally Posted by Kafrin View Post
    You could try running a quick macro to delete ListBox1

    Please Login or Register  to view this content.
    This is what I was looking for...!!! With one small exception.
    My "invisible" control is on a UserForm, not a worksheet.
    How do I write code to delete a control from a UserForm, in the event that I ever need to??

    I won't have to do that in this situation...not after reading this:

    Quote Originally Posted by romperstomper View Post
    Do you have any frame controls or multipages on the form?
    YES...!!! I DO have TWO frame controls on the UserForm...!!!
    I thought about this myself, a few hours ago...and I THOUGHT that I had checked the Properties of the frame controls
    for the AWOL control. Apparently, I didn't check BOTH frame controls...because I JUST found the dang control in the second Frame!!!
    I pulled the lower border of the Frame control down...and there was my ListBox peeking up from underneath the frame...!!!
    UNBELIEVABLE...!!! This explains how my control "disappeared" while I was dragging it to a new position.
    I must have released it while I was INSIDE the frame.

    Such a simple thing...and it robbed me of 3 hours of my life...!!!

    Thanks for taking the time to answer my post, guys.
    Last edited by HuskerBronco; 06-27-2011 at 10:38 AM. Reason: Fix typos

  7. #7
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Re: UserForm Control disappeared

    Quote Originally Posted by mikerickson View Post
    Rename the control currently named ListBox2 to have the name ListBox1, using the Properties window.
    Can't do that Mike....That was the problem.

    When I tried to do that, I got an "ambiguous name" error.

  8. #8
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: UserForm Control disappeared

    Quote Originally Posted by HuskerBronco View Post
    My "invisible" control is on a UserForm, not a worksheet.
    How do I write code to delete a control from a UserForm, in the event that I ever need to??
    Just FYI, the code would look something like:
    Please Login or Register  to view this content.
    although please note I haven't tested this.

+ 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