XL: Can't Change Size or Position of Object in Custom DialogLast reviewed: February 3, 1998Article ID: Q117134 |
The information in this article applies to:
SYMPTOMSIn Microsoft Excel, you cannot use the Width, Height, Top, or Left properties of the DrawingObjects object to change the size or position of an object in a custom dialog box while the dialog box is displayed. NOTE: This limitation does not apply to objects in UserForms in Microsoft Excel 97 for Windows or Microsoft Excel 98 Macintosh Edition.
CAUSEThis is by design in Microsoft Excel. You can move and size an object on a dialog sheet, and the object is displayed with this size and position when you display the dialog box. However, because a dialog box is not updated during an event macro (only after the event macro finishes), you cannot dynamically move or resize an object in the dialog box while the dialog box is displayed. Note that you also cannot change the size or position of a custom dialog box when you use the Show method to display the dialog box.
WORKAROUNDMicrosoft provides programming examples 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 article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/default.aspTo work around this behavior, you can link a picture of an object on a worksheet to a custom dialog box, and then move the object on the worksheet using a Visual Basic module assigned to a button in the dialog box.
Example of Visual Basic ProcedureFor an example of using this method, do the following:
MORE INFORMATIONFor more information about positioning a custom dialog box, query on the following words in the Microsoft Knowledge Base:
directly and possible and on-screen and position and dialog |
Additional query words: 5.00 5.00a 5.00c 7.00 7.00a XL5 XL7 vba
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |