Receiving Error Message: Cannot Insert Object When Using MS Excel XP
Note: The following error message may appear when using a Visual C++ control in Microsoft Excel 2002.
- A control is created in Visual C++, thus, this error occurs. The _wVerMajor and/or _wVerMinor variables were manually changed, and the corresponding type library version number in the .odl file of the project was not changed.
This happens because Excel 2002 checks to see if these two variables are equivalent in the registry.
- This problem can be resolved by changing the version() attribute in the .odl file to reflect the current state of the _wVerMajor and _wVerMinor variables at compile-time.
- Another option is by modifying the registry entry HKCR\TypeLib\[Your TypeLib]\X.Y, where X and Y represent the major and minor version numbers respectively.