Getting Visual Basic projects to load into the VB IDE
After registering different versions of controls VB may give errors when trying to load your projects. Do the following in order, testing after each step to see if the problem is resolved:
* VB may be using a Type Library cache file which refers to the wrong version of the control. These files have the extension OCA. Delete all the OCA files and preferably clean up the registry using RegClean from Microsoft or better still COMclean. VB will regenerate the OCA files as needed.
** The project file may specify a version of the type library which is not registered. This can be repaired by editing the VBP project file to require version 1.0. As an example you will find the line:
for the Common Controls if the VB6 (Version 1.3) controls are required. Edit the project files to require Version 1.0 of the controls. When the project loads the version of the control which is available will be used, and the VBP file changed to suit. This is done regardless of the state of the "Update ActiveX controls" flag. If you still get an "Unexpected error", try Version 1.1. If it still does not work, find out which version is registered and use that. To use a specific version of a control make sure that it is the one which is registered. COMclean from RHA (Minisystems) Ltd. can show which files are registered, screen shots are on this page here.
*** If you are getting "Licence not found..." the VB installation has not worked. Probably, the computer already had the same or newer versions of some of the controls. The installation will not overwrite the files and does not install the licences either. Unregister the controls and remove them from the system folder. Reinstall VB and try again, the control OCXs and licences should have been installed. You can now replace them by newer versions of the controls if you wish.
**** The TypeLib section of the registry may contain version numbers which are not in fact available. The version numbers which are not available may be higher or lower than the one which is available. An explanation of how this situation arises is on this page here, how to fix the problem using COMclean (including screen shots showing invalid type libraries) is described here. The Microsoft Knowledgebase article is Q221990.