BUG: Microsoft Excel Does Not Repaint Properly with Automation (187745)
The information in this article applies to:
- Microsoft Excel 2000
- Microsoft Visual Basic for Applications 5.0
- Microsoft Office XP Developer
- Microsoft Office 2000 Developer
- Microsoft Excel 2002
- Microsoft Excel 97 for Windows
This article was previously published under Q187745 SYMPTOMS
When automating Microsoft Excel 97, Excel 2000, or Excel 2002, if the application window has been made visible and the user manually closes it, Excel will not repaint correctly the next time the application window is made visible again.
CAUSE
This problem occurs when a user attempts to quit a running instance of
Excel while an Automation client still has a reference to the application
object for that instance. By design, Excel does not quit an
instance of itself unless all external references are released; if a user
tries to quit Excel manually, the application window is merely hidden so
that the Automation client may continue working. If, however, the
Automation client attempts to make Excel visible again, the application
window will not be displayed properly and repainting will not occur.
RESOLUTION
A workaround is to set the ScreenUpdating property of the application
object to True after you have made the window visible. This will force
Excel to repaint its client area so that it will be displayed properly.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 3/9/2005 |
---|
Keywords: | kbAutomation kbbug kbinterop kbpending KB187745 |
---|
|