+ Reply to Thread
Results 1 to 2 of 2

Problems with programatically referening libraries

  1. #1
    DW
    Guest

    Problems with programatically referening libraries

    Hi Damon,

    I have attempted to use the references collection ... with little success!

    I wanted to reference an Outlook Object library, depending on the version of
    Outlook that was installed on the user's machine. I seached their harddrive
    for the appropriate library, and then attempted to "tick" that reference
    using the refs collection. This particular library was already in the
    reference list (unchecked), and would not allow me to add another ref with
    the same name!!!

    Do you know of a way to check items (programatically) within the "references
    Dialog?

    cheers,
    DW

  2. #2
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    I've used the below before...

    ...the main part for checking/unchecking is to use the .installed.

    Function Load_XL_AddIn(strFilePath As String, strAddInName As String) As Boolean
    Dim addXL As Excel.addin

    On Error Resume Next
    strAddInName = Left(strAddInName, Len(strAddInName) - 4)

    Set addXL = Excel.AddIns(strAddInName)
    If Err <> 0 Then
    Err.Clear

    Set addXL = Excel.AddIns.Add(strFilePath, 1)
    If Err <> 0 Then
    Load_XL_AddIn = False
    GoTo Load_XL_AddIn_End
    End If

    End If

    If Not addXL.Installed Then addXL.Installed = True
    Load_XL_AddIn = True

    Load_XL_AddIn_End:
    Exit Function
    End Function

+ 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