XL5: Control Missing/Incorrect Location After Moving Dialog

Last reviewed: September 12, 1996
Article ID: Q119097
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SYMPTOMS

In Microsoft Excel, when you hide a control on a custom dialog box, and you then move the dialog frame on the dialog sheet, when you attempt to redisplay the control in the dialog box, the control is not displayed or it is displayed in the wrong location.

CAUSE

This behavior occurs because Microsoft Excel does not move hidden objects. Therefore, when you hide a control on a dialog box, and you then move the dialog box frame, the control does not move with the dialog box. Because the control does not move, it either appears in the wrong location on the dialog box or is not displayed on the dialog box at all.

WORKAROUNDS

To avoid this behavior, do not move the dialog frame when controls on the dialog box are hidden. Instead, use the Visible method in a Visual Basic procedure to display all of the objects on a dialog box, and then move the dialog frame to the desired location on the dialog sheet. The following example displays all of the objects on the Dialog1 dialog sheet:

Microsoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.

   Sub Display_All()
      Dim DlgObj As Object
      For Each DlgObj In DialogSheets("Dialog1").DrawingObjects
         DlgObj.Visible = True
      Next
   End Sub

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel version 5.0c for Windows.

REFERENCES

"Visual Basic User's Guide," version 5.0, Chapter 11, "Controls and Dialog Boxes"


KBCategory: kbprg
KBSubcategory:

Additional reference words: 5.00



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 12, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.