Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Can't remove control or reference in use

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 05-12-2009
Member
 
Join Date: Jul 2009
Posts: 104
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?

Reply With Quote
  #2  
Old 05-12-2009
Member
 
Join Date: May 2008
Posts: 980
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.
Reply With Quote
  #3  
Old 05-12-2009
Member
 
Join Date: May 2008
Posts: 249
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.
Reply With Quote
  #4  
Old 05-12-2009
Member
 
Join Date: May 2008
Posts: 279
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Can't remove control or reference in use"
Thread Thread Starter Forum Replies Last Post
How to remove an ActiveX Control in Internet Explorer 7 Triple-X Technology & Internet 3 08-09-2009 12:40 AM
How to remove invalid icon from Control Panel? Faakhir Windows Software 4 20-04-2009 01:06 PM
Programs in Add Remove has disappeared from control panel Volodymyra Operating Systems 3 02-03-2009 10:37 PM
Can't remove or modify programs from control panel Add/Remove Programs any more.. gemss Windows XP Support 3 15-11-2008 07:27 PM
Unable to Remove Printers in Control Panel mishutka Vista Help 8 22-05-2008 01:15 AM


All times are GMT +5.5. The time now is 12:02 AM.