+ Reply to Thread
Results 1 to 4 of 4

Remove Reference Library Programmatically

  1. #1
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Remove Reference Library Programmatically

    Hi All

    I'm trying to programmatically add and remove the Outlook 11.0 Reference Library in Excel 2003.

    So far, I have found the following code which successfuly adds the reference:

    Please Login or Register  to view this content.
    But when I try to remove it using the following code, it doesn't work.

    Please Login or Register  to view this content.
    Does anybody have any suggestions of what I'm doing wrong?

    Dion
    Last edited by mojo249; 01-12-2010 at 06:13 PM.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,256

    Re: Remove Reference Library Programmatically

    As in your first code, the argument you pass to the Remove method is a Reference object, not a string (or GUID). To do it using a GUID, I think you would have to loop through all the references, check the GUID property and, if it matches, remove it.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Remove Reference Library Programmatically

    Perhaps:

    Please Login or Register  to view this content.
    R, will have better code to hand I'm sure but there was a general conversation on this some time back on another thread:

    http://www.excelforum.com/excel-prog...eferences.html

    Of course in the above as new libraries are created by MS so the Select Case in the above would require update.

  4. #4
    Forum Contributor
    Join Date
    05-09-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    315

    Re: Remove Reference Library Programmatically

    Thanks both.

    The code in the previous thread worked a treat!

    Dion

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1