BUG: CommandBar Control Reference Becomes Invalid Before COM Add-In's OnDisconnection Event Fires (230876)
The information in this article applies to:
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Office Word 2003
- Microsoft Word 2002
- Microsoft Word 2000
This article was previously published under Q230876 SYMPTOMS Global object references to CommandBar controls are not valid in the OnDisconnection event of your COM Add-in when they are hosted in Microsoft Word.
You might receive the following error message when you attempt to call a method
or property on the invalidated object reference in the OnDisconnection event: Run-time error '424': Object
Required The problem may occur regardless of whether the object
reference is to a custom or a built-in CommandBar control. NOTE: You may also encounter the problem with the global CommandBar
control object reference becoming invalid in the OnStartUpComplete and OnBeginShutdown events. RESOLUTION To work around the problem, use the FindControl method to obtain a new object reference to the CommandBar control. This solution is illustrated in the "More Information"
section. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 3/23/2006 |
---|
Keywords: | kbAutomation kbbug kbpending KB230876 |
---|
|