BUG: Interface methods in the VBA Extensibility Library (VBE) are changed (269116)
The information in this article applies to:
- Microsoft Office 2000 Developer
- Microsoft Visual Basic for Applications (VBA) Software Development Kit (SDK) 6.0
This article was previously published under Q269116 SYMPTOMS
An out-of-process Automation client that early binds to the Visual Basic for Applications Extensibility 5.0 Library (VBEEXT1.OLB) of Microsoft Office 97 may receive the following error message when an Office 2000 application (or another VBA 6.0 host) is installed on the system:
In Visual Basic:
Run-time error 430:
Class does not support Automation or does not support expected interface.
In Visual C++:
0x80004002 (-2147467262)
E_NOINTERFACE: No such interface supported.
The error message only occurs when the system in question has an Office 2000 application (or VBA6 host application) installed, but the automation server is still an Office 97 (VBA5) application. If the application being automated is upgraded to Office 2000 (VBA6), the client application works normally without changes.
CAUSE
Microsoft Office 2000 ships with version 5.3 of the Visual Basic for Applications Extensibility Library (VBE6EXT.OLB). This library contains the type information for both the VBA5 (Office 97) and VBA6 (Office 2000) extensibility object model, and is designed for backward compatibility. Because the library shares the same library ID (LIBID) as version 5.0, it effectively acts as a replacement for the older type library. Under normal circumstances this would be fine because the library was designed for backwards compatibility.
However, the root (VBE) object did not change between versions and was not
updated with a new interface for VBA6. But many of the objects accessed from that object did change and the methods of VBE now point to the new
interfaces (with new IIDs) instead of the old ones.
Because VBA uses the universal marshaller to remote its interfaces, this mistake can cause Component Object Model (COM) to incorrectly ask the server application for the new (VBA6) interfaces when constructing the proxy/stubs. Because older VBA5 servers do not support these interfaces, they report an error during this construction, and COM reports the error to the client in the preceding manner.
Re-registering the old type library (VBEEXT1.OLB) over the new one (VBE6EXT.OLB) resolves the issue for clients communicating with Office 97 (VBA5) servers, but could result in application errors or faults for new clients that early bind to Office 2000 (VBA6). Microsoft does not recommend this solution.
RESOLUTION
To avoid the problem permanently, Microsoft recommends that clients perform late binding to the VBE object.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
Modification Type: | Major | Last Reviewed: | 11/21/2005 |
---|
Keywords: | kbAutomation kbbug kbnofix kbprogramming KB269116 |
---|
|