Can't remove control or reference in use
Hi,
I can't remove as a component in a Visual Basic 6. I removed all the program lines that are associated with this ocx. I turned the computer off and on and restarted the program. I have tried to disable this program in the form ocx component. I get a "Can't remove control or reference in use" message. Any suggestions?
Re: Can't remove control or reference in use
Remove all controls on the form (s) that are associated with this ocx. Only the elimination of references to code that will not remove it, and VB6 do not leave a reference until all cases have been withdrawn from all forms.
Re: Can't remove control or reference in use
To identify and to minimize references to COM libraries in your project, follow these steps:
1. Open your project in Visual Basic 6.0.
2. On the Project menu, click References.
3. Notice the reference libraries that are selected. Every Visual Basic 6.0 application requires the following references. You cannot remove these references.
* Visual Basic for Applications
* Visual Basic runtime objects and procedures
* Visual Basic Objects and Procedures
Other reference libraries that are selected may not be required for your application.
4. To remove a reference to a reference library that your application does not use, click to clear the check box next to the reference library name.
Note If you do not know whether your application uses a reference library, click to clear the check box to that reference library. If you receive an error message such as the following, your application uses that reference library:
Code:
Can't remove control or reference; in use
Restore these references before you go to step 5.
5. For the remaining references that are selected, make a note of the version and the location of the reference library.
6. To close the References dialog box, click OK.
Re: Can't remove control or reference in use
To need to modify a given project's VBP file to include the Microsoft Excel 8.0 Object Library just for that project.
1. Save and close the project with the Microsoft Excel 5.0 Object Library reference.
2. In a text editor such as NOTEPAD.EXE, open the project's VBP file and change the reference to Microsoft Excel from:
Code:
Reference=*\G{00020813-0000-0000-C000-000000000046}#1.0#9#C:\OFFICE97\_
OFFICE\XL5EN32.OLB#Microsoft Excel 5.0 Object Library
to:
Code:
Reference=*\G{00020813-0000-0000-C000-000000000046}#1.2#0#C:\OFFICE97\_
OFFICE\EXCEL8.OLB#Microsoft Excel 8.0 Object Library
3. Save the project's VBP file and close the text editor.
4. Start Microsoft Visual Basic 4.0x, and then load and save the project.
5. Select Tools, then References. The Microsoft Excel 5.0 Object Library no longer appears in the list. Instead, the Microsoft Excel 8.0 Object Library is available and checked for use with this project. Newly- created projects will revert to the Microsoft Excel 5.0 Object Library.