• Programmatically removing references (2000/2002)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Programmatically removing references (2000/2002)

    • This topic has 3 replies, 3 voices, and was last updated 22 years ago.
    Author
    Topic
    #388893

    I know that you can use the VBA Extensability object model to access a Projects references but when I try to use the Remove method I get an error that the object doesn’t support that method. Has anyone had any experience with this?

    Thanks
    Ed

    Viewing 1 reply thread
    Author
    Replies
    • #684674

      Try the following approach, where Reference2BRemoved is the refernce you wish to remove :

      Dim oRef
      Set oRef = Reference2BRemoved
      Application.VBE.ActiveVBProject.References.Remove oRef.

      That should work even without a reference to the VBA Extensability, unless of course you are trying to remove that reference.

      Andrew C

    • #684815

      If the above doesn’t help, please post the relevant portion of code. We’ve had posts here, but it’s probably more efficient to eyeball the code than dig through.

    Viewing 1 reply thread
    Reply To: Programmatically removing references (2000/2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: