PRB: Error Message "Cannot insert object" in Excel (171280)
The information in this article applies to:
- Microsoft Excel 2000
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Excel 2002
- Microsoft Excel 97 for Windows
This article was previously published under Q171280 SYMPTOMS
The following error message appears when you attempt to use
your Visual C++ control in Microsoft Excel 97, Microsoft Excel 2000, or Microsoft Excel 2002:
Cannot insert object
CAUSE
This error occurs if you created a control in Visual C++, manually changed
the _wVerMajor and/or _wVerMinor variables, and didn't change the
corresponding type library version number in the .odl file of your project.
This occurs because Excel 97, Excel 2000, and Excel 2002 explicitly check to see if these two variables are equivalent in the registry.
RESOLUTION
To resolve this problem, you either have to change the version() attribute
in your .odl file to reflect the current state of the _wVerMajor and
_wVerMinor variables at compile-time, or specifically modify the registry
entry HKCR\TypeLib\<Your TypeLib>\X.Y, where X and Y represent your major
and minor version numbers respectively.
STATUS
This behavior is by design.
REFERENCES
For more information about the wVerMajor or wVerMinor global constants,
search for "wVerMajor" or "wVerMinor" in Visual C++ Help.
For more information about ODL (Object Description Language) files and the
version() attribute, search for "ODL" or "ODL Attributes" in Visual C++
Help.
Modification Type: | Minor | Last Reviewed: | 3/9/2005 |
---|
Keywords: | kberrmsg kbprb KB171280 |
---|
|