Results 1 to 9 of 9

Thread: on workbook open, form optionbutton loses position when unhidden

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    25
    Rep Power
    0

    Unhappy on workbook open, form optionbutton loses position when unhidden

    Hi,

    i am currently facing a very odd problem with optionbuttons and groupboxes.

    i have generated a set of form optionbuttons on a worksheet on certain rows and placed inside groupboxes, where each groupbox encloses 4 optionbuttons.

    When i click the Reset button, the rows 14:56 hide along with the groupboxes and optionbuttons placed in them.
    when i click the UnReset button, the rows 14:56 unhide along with the groupboxes and optionbuttons placed in them.

    Now, the problem:

    when i Reset or Hide the rows, groupboxes and optionbuttons and then SAVE the workbook and close it, then when i reopen it again, and click the unReset button to unHide the rows, groupboxes and optionbuttons, i see that all the optionbuttons, groupboxes etc lose their positions and only line up on the starting row 14.

    P.S: i have not hidden the rows in the attached workbook, so that you can try and see the issue on your own.

    please advise.
    Attached Files Attached Files

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Without opening your file, can I ask whether you changed the property of the shapes to 'Do Not Move or Size With Cells'

    If not, try doing that, and check the workbook again.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Junior Member
    Join Date
    May 2012
    Posts
    25
    Rep Power
    0
    Hi ExcelFox,

    the optionbuttons were created using the default setting i.e. OptionButton.Placement = xlFloating & not OptionButton.Placement = xlMove. Even if i hardcode OptionButton.Placement = xlFloating, it still moves. Actually, i have tried both alternatives, but still the optionbuttons move from the original location.

    See the problem is, if i delete and generate buttons and then hide/unhide buttons, it works well, no issues. But if i hide the buttons, save & close file, and then open it again, then try to unhide it, then the optionbuttons donot stay in their correct position.

    please advise.
    Last edited by Junoon; 08-02-2012 at 12:51 PM.

  4. #4
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    I don't see any shift in position after unhiding after saving and closing with the buttons hidden. The only advice I can give is that the syntax you should use is xlFreeFloating, not xlFloating
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  5. #5
    Junior Member
    Join Date
    May 2012
    Posts
    25
    Rep Power
    0
    Hi ExcelFox,

    Thank you for replying.

    yes it was a typo error.

    Well, i think before closing the file you must have unhidden it. try hiding the controls using the reset button. save, close and then open the file and then unhide the controls. i am sure you will see error.
    Last edited by Junoon; 08-02-2012 at 02:48 PM.

  6. #6
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    I did just that! No difference at all!
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  7. #7
    Junior Member
    Join Date
    May 2012
    Posts
    25
    Rep Power
    0
    i tried this in Excel 2007/2010. in both versions, i am getting same issue. waiting to test in 2003. will let you know soon.

  8. #8
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    I am on 2007...
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  9. #9
    Junior Member
    Join Date
    May 2012
    Posts
    25
    Rep Power
    0
    hi,

    apologies for the delay. tried posting y'day but the website was down for maintenance.

    i have found that .placement =xlfreefloating works very well for hiding/unhiding all optionbuttons on worksheet on workbook open. thanks.

    However, now hiding and unhiding individual rows of optionbuttons (region rows) based on tick/untick of region checkboxes donot work. the option buttons and groupboxes donot hide, but shift up or down. what could be the reason? please advise.

    P.S i have attached the latest file.
    Attached Files Attached Files

Similar Threads

  1. Open And Activate Workbook Before Runing Macro
    By Howardc in forum Excel Help
    Replies: 5
    Last Post: 06-04-2013, 07:23 PM
  2. VBA Code to Open Workbook and copy data
    By Howardc in forum Excel Help
    Replies: 16
    Last Post: 08-15-2012, 06:58 PM
  3. Get Name List of All Open Workbook Files
    By princ_wns in forum Excel Help
    Replies: 5
    Last Post: 04-07-2012, 12:18 PM
  4. Assign an event to chart on workbook open
    By LalitPandey87 in forum Excel Help
    Replies: 2
    Last Post: 02-20-2012, 07:43 AM
  5. Replies: 1
    Last Post: 06-02-2011, 10:38 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •