Article ID: 213537 - Last Review: October 11, 2006 - Revision: 4.2 XL2000: Redraw Problem Changing Visibility of Object on Dialog BoxThis article was previously published under Q213537 SYMPTOMS
When you run a Microsoft Visual Basic for Applications macro that changes the Visible property for a drawing object on a Microsoft Excel 5.0 dialog sheet that is displayed, the border of the drawing object may not appear correctly.
When you set the Visible property to True, the border of the drawing object may not be displayed completely. Conversely, when you set the Visible property to False, the border of the drawing object may not be erased completely. CAUSE
This problem occurs because Microsoft Excel does not redraw the screen
correctly.
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to 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 requirements. To work around this problem, use a UserForm instead of a Microsoft Excel 5.0 dialog sheet. A UserForm is more flexible and offers more functionality than a Microsoft Excel 5.0 dialog sheet. If you must use a Microsoft Excel 5.0 dialog sheet, you can use an alternative method. When you change the Visible property for the shape, close the dialog sheet, and then display it again. This forces Microsoft Excel to redraw the screen, which causes the border around the shape to appear correctly. The following example forces Microsoft Excel to do this:
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
| Article Translations
|
Back to the top
