Results 1 to 4 of 4

Thread: Can't remove control or reference in use

  1. #1
    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?

  2. #2
    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.

  3. #3
    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.

  4. #4
    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.

Similar Threads

  1. How to remove an ActiveX Control in Internet Explorer 7
    By Triple-X in forum Technology & Internet
    Replies: 3
    Last Post: 07-09-2009, 11:40 PM
  2. How to remove invalid icon from Control Panel?
    By Faakhir in forum Windows Software
    Replies: 4
    Last Post: 20-04-2009, 12:06 PM
  3. Programs in Add Remove has disappeared from control panel
    By Volodymyra in forum Operating Systems
    Replies: 3
    Last Post: 02-03-2009, 09:37 PM
  4. Replies: 3
    Last Post: 15-11-2008, 06:27 PM
  5. Unable to Remove Printers in Control Panel
    By mishutka in forum Vista Help
    Replies: 8
    Last Post: 22-05-2008, 12:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •