I've got a strange problem... On the first sheet in my workbook (basically the "cover page"), I have several VB Checkboxes to indicate which sheets are displayed. If the checkbox is checked, the related sheets are shown, unchecked, they are hidden.
This is one of the simpler cases, but here is some sample code (other buttons hide more than one sheet, or hide the sheet based off the name in cases the number of sheets is dynamic):
That works great. The strangeness starts after a print preview when one of the checkboxes was the last item selected. If the last action was to check a checkbox (but not uncheck -- things work fine then!) before clicking "File --> Print Preview" then "Close" all the checkboxes except the one that was active when doing the print preview disappear.
If I remove all the code for the checkboxes the problem disappears. Adding it back for even one checkbox causes the problem to return. If I create a completely new workbook, add in a pile of blank sheets and then add in some checkboxes and apply the same macros I don't have the problem.
Personally, I think the chances of someone having this happen to them when the form is in use is pretty slim (considering the exact conditions that must be met for it to happen), but my users want to dummy-proof this as much as possible (I have added buttons to add in a new line on some of the sheets).
I am in a strictly controlled environment running Excel 2000, so I wouldn't be surprised if the problem stems from that. Anyone have any ideas, or do I tell my users they are out of luck?
Bookmarks