+ Reply to Thread
Results 1 to 15 of 15

Buttons disappear when rows are hidden/unhidden in 2010

  1. #1
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Buttons disappear when rows are hidden/unhidden in 2010

    In an Excel 2010 worksheet with command buttons set to "Move and Size with Cells", if you hide the columns they are in (which also hides the buttons), then save and close the workbook, when you reopen the workbook and unhide the columns, the button widths remain at 0, making them invisible. The problem will not show up until you have closed and reopened the workbook. If you save it with the columns hidden, then unhide them, the buttons reappear as they should, but then if you close (without saving) and reopen the workbook, they're gone.

    The only way to show them, other than resetting the width with code, is to go to design mode, select another button or object, and hit Tab until it lands on the hidden object. Then you can drag it wider.

    My app does a lot of column hiding & unhiding, as well as saving and routing through Outlook with attachments, so I don't see a reasonable VBA solution. Whenever it unhides columns it would have to loop through all the objects, try to determine if any were in the hidden columns, and then somehow determine what the original width was. I suppose it's doable, but not reasonable or acceptable in my opinion.

    Has anyone encountered this? Is there a reasonable workaround or solution to this bug?
    It's not a problem in 2003 where I developed the app, but even if I create new buttons in 2010 and save it as a .xlsm, it still does the same thing. I took half a day digging through my code because I thought it was a VBA problem, but finally realized I could reproduce it manually. I would really appreciate some help with this.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    There seem to have been a lot of problems reported with Excel 2010 and controls on worksheets. I have yet to see any official MS response though (but they have been made aware of it).
    Remember what the dormouse said
    Feed your head

  3. #3
    Valued Forum Contributor natefarm's Avatar
    Join Date
    04-22-2010
    Location
    Wichita, Kansas
    MS-Off Ver
    2016
    Posts
    1,020

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    Thanks for the response. At least I know I'm not crazy (though after spending half a day figuring out what the problem was, and another half a day developing a workaround, I'm getting close). It was more challenging than I thought it would be to make it work, because not only do the objects lose their width. They also, in some cases, lose their .left property and get stacked on top of each other.

    I thought it might be helpful to someone else to provide the code I used to make it work. I hope it makes sense out of context. It's for an employee performance appraisal system, if that's any help.

    Also, the objects' Format Control properties must be set to "Move and size with cells".
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-16-2012
    Location
    Mars
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    I have this problem too. I wrote vba to ungroup everything before saving, and then regroup, but even with turning off screen updating it doesn't look very good.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    Ctrlshiftenter (nice user id )

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Registered User
    Join Date
    07-16-2012
    Location
    Mars
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    Quote Originally Posted by arlu1201 View Post
    Ctrlshiftenter (nice user id )

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Thanks for the welcome.

    I'm not sure how I broke Rule 2. It wasn't a question. It was one fix to the problem with the the mentioned draw backs.

  7. #7
    Registered User
    Join Date
    07-24-2012
    Location
    Verona, WI
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    Hey, I thought I'd let you know that I see the same behavior (Excel 2010). It seems like when you have a button with the "Move and Size with Cells" property set, they're somehow left in the minimzed/hidden state even after expanding a set of grouped rows. Once you change that property to something else like "Don't move or size with cells", the buttons look awkward when you minimize the grouped rows.

    I'm going to just try to manage without minimizing the grouped cells. I imagine you could add some handling that forces the button to resize to the width/height of the cell after you expand the grouped rows... but doesn't sound easy :-\

  8. #8
    Registered User
    Join Date
    07-16-2012
    Location
    Mars
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    I ended up showing all outline levels before saving and then setting it back after saving or when opening (using Workbook_BeforeSave, Workbook_AfterSave, and Workbook_Open). You can see it expand and close when you save, which is unsettling, but it works.

    HTML Code: 

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    @stru0121
    @ctrlshiftenter (notified once already on 7/16)

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. (Do not resurrect old threads with new solutions.) If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

    Please stop posting in other OP threads. This one is more than a year old.
    Last edited by protonLeah; 07-24-2012 at 03:55 PM.
    Ben Van Johnson

  10. #10
    Registered User
    Join Date
    07-22-2014
    Location
    Dallas, Tx
    MS-Off Ver
    2013
    Posts
    1

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    To anyone that comes here, to stop your button from vanishing with hiding/filtering cells/rows/etc:

    Right click button -> Format Control -> Properties Tab -> "Don't move or size with cells"

  11. #11
    Registered User
    Join Date
    01-14-2016
    Location
    London, England
    MS-Off Ver
    Windows uber
    Posts
    3

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    Everyone above is wrong or refer to non-general solutions. Now, I will assume that the hiding and unhiding is a part of a macro, since buttons at all are in the question.

    There are two elements to the general solution. One has already been presented.

    It is possible to format the buttons so that they do not size with the sheet. As someone has mentioned, this makes them hang awkwardly atop hidden rows. Therefore, we need to add lines of code to hide the button together with hiding the lines. Now you will get invisible (and unclickable) buttons that do not change their size as rows are hidden and unhidden. In order to hide a button you use the following code lines:

    ThisWorkbook.Sheets("Your_sheetname").Shapes("Button 7").Visible = False

    and

    ThisWorkbook.Sheets("Your_sheetname").Shapes("Button 7").Visible = True

  12. #12
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    Quote Originally Posted by egrdfgsdfg View Post
    Everyone above is wrong or refer to non-general solutions.
    This is big statement. Also is wrong: https://support.microsoft.com/en-us/kb/2503335

    It is bug with 2010.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  13. #13
    Registered User
    Join Date
    01-14-2016
    Location
    London, England
    MS-Off Ver
    Windows uber
    Posts
    3

    Cool Re: Buttons disappear when rows are hidden/unhidden in 2010

    I think you mean bold statement. Nonetheless, the statement is true and relevant for new visitors to this thread.

    From the title of my post it is clear that the issue refers to version 2010, but that information is not a solution. Nor is the windows approach. There is just no way that I can send out a document to the users and say "By the way, if you have excel 2010 then you need to go into regedit to make the document work properly, please try not to screw up the computer".

    The seniors are awfully chilly in this forum, aren't you?
    Last edited by egrdfgsdfg; 01-15-2016 at 06:10 AM.

  14. #14
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    Is only solution if your assumption is correct. If user will hide column manually, problem may still occur.

    This is not competition - there is no score. I am happy you think you are best.

  15. #15
    Registered User
    Join Date
    01-14-2016
    Location
    London, England
    MS-Off Ver
    Windows uber
    Posts
    3

    Re: Buttons disappear when rows are hidden/unhidden in 2010

    Granted, Izandol.

+ 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