Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post

    Programmatically removing references (2000/2002)

    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

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Programmatically removing references (2000/2002)

    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

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Programmatically removing references (2000/2002)

    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.

  4. #4
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Programmatically removing references (2000/2002)

    The previous post worked like a champ.

Posting Permissions

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