Custom Dialog Box Leaves Copy on Screen When Moved in Excel

Last reviewed: September 12, 1995
Article ID: Q72616
The information in this article applies to:
  • Microsoft Excel for Windows, versions 3.0, 4.0, 4.0a, 5.0
  • Microsoft Excel for the Macintosh, versions 3.0, 4.0, 5.0

SUMMARY

When a movable custom dialog box is created in Microsoft Excel, it will leave a copy of itself in the original location when moved if an =ECHO(FALSE) command is included in the macro before the dialog box is called.

NOTE: This information applies when using Excel 4.0 macros when using Microsoft Excel 5.0

MORE INFORMATION

Microsoft Excel provides the ability to create custom dialog boxes that can be moved. This is accomplished by entering a title for the dialog box in the text column of the first line in the dialog box definition. This creates a title bar and control menu (-) for the dialog box when it is displayed. The dialog box may then be moved by clicking the title bar and dragging the box or by accessing the control menu (-) and selecting Move. The latter technique allows you to move the dialog box without a mouse.

When an =ECHO(FALSE) command is included in the macro prior to the =DIALOG.BOX(range) command, and the dialog box is then moved to a new position, it will still be displayed in the original location. This is because the =ECHO(FALSE) command suspends screen updating while the macro is running. The macro is not completed until after the dialog box is removed from the screen, so the original location of the dialog box is not redrawn until this time.

The solution to this problem is to remove the =ECHO(FALSE) function from the macro, or to insert an =ECHO(TRUE) command into the macro prior to the =DIALOG.BOX() function.

Note that movable custom dialog boxes were not possible in Excel 2.x.

REFERENCES

"User's Guide 2," version 4.0, page 272 "User's Guide," version 3.0, page 632 "Function Reference," version 4.0, page 122 "Function Reference," version 3.0, page 62


KBCategory: kbusage
KBSubcategory:

Additional reference words: 3.0 3.00 4.0 4.00 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, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.