+ Reply to Thread
Results 1 to 4 of 4

VB - MultiPage vs RefEdit vs OptionButton

  1. #1
    Registered User
    Join Date
    03-19-2008
    Location
    Prague, CZ
    Posts
    11

    VB - MultiPage vs RefEdit vs OptionButton

    Hello,
    I use Excel 2007. I made a UserForm with some CommandButtons and a MultiPage object with two Pages - one containing several RefEdits, the other containing several OptionButtons and a TextBox.
    On Page1 of the MultiPage, I want the user to put some ranges from the Sheet or some text (or leave it blank, whatever) into the RefEdits. One of the CommandButtons on the UserForm (ie. outside the MultiPage) fills some deafult values into these RefEdits and I want it to fill the default values in RefEdits regardless of which Page is active (that, however, does not seem to be the problem).
    On Page2, the OptionButtons modify the TextBox contents. I want the TextBox to be disabled unless one of the OptionButtons is checked. You know that probably - you give the user several predefined choices and a "custom" choice with a TextBox.

    Now, the problem is, it often behaves "strangely".
    Sometimes it "crashes" - the UserForm dissapears when you click a control. Looks like the problem described at http://support.microsoft.com/kb/213673 because one of the RefEdits gets focused (although the user didn't even enter Page1).
    Sometimes it "freezes" - the CommandButtons don't react (the "Close" or x button of the window works).
    In both cases, it doesn't matter whether user clicks the CommandButton to fill in the default values.

    A typical OptionButton_OnClick looks like this (TBFormat is the TextBox on Page2):

    Please Login or Register  to view this content.
    The custom one:

    Please Login or Register  to view this content.
    What is wrong?
    W.

  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,258
    Hello wiggles,

    I experienced a similar problem using 2003. The problem occurred because my UserForm was being shown Non-modal. The RefEdit controls are owned by the UserForm. Showing the UserForm non-modally removes that ownership. The system gets confused because it referencing an invalid window handle. No telling what it is pointing to.

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    03-19-2008
    Location
    Prague, CZ
    Posts
    11

    Re: Leith

    Hello Leith,
    actually, the UserForm is shown modal (it's even the default).
    I made another UserForm without MultiPage (all controls right in the UserForm - in my case it's still bearable) and it doesn't suffer the problem (shown modal, of course). So it seems, either the MultiPage confuses RefEdits or I don't manipulate one of them correctly.
    However, thanks for advice, I've learned new things.

    Sincerely
    wiggles

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good morning wiggles

    Quote Originally Posted by wiggles
    So it seems, either the MultiPage confuses RefEdits or I don't manipulate one of them correctly.
    You'll probably find it's the former. RefEdits tend to behave themselves until you enclose them in something (eg, a frame, multipage etc) then they start to throw off all sorts of odd results, which can include crashes.

    Nice to see that MS didn't bother to fix this undocumented "feature" in XL2007.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

+ 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