Consulting

Results 1 to 5 of 5

Thread: Solved: check for add in progmatically

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Solved: check for add in progmatically

    Is it possible to check for the existance of an add in using vba?

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    For i = 1 To AddIns.Count
        MsgBox AddIns(i).Name & " installed " & AddIns(i).Installed
    Next i
    There are other properties that can be found by searching on Addin in the Object Browser.

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    OK. So now is it possible to check for a specific add in and if it is not installed install it? Probably could use the macro recorder to do the install but checking for a specific install is the part im stuck on.

  4. #4
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    The Addings(index).Installed sometiems gives an error if index is a string, but always works if its an integer (long?).

    If I was looking for "oneAddIN",

    Sub test()
    Dim addinName As String
    Dim i As Integer, nameExists As Boolean
    addinName = "oneAddIN":Rem caps sensitive
    For i = 1 To AddIns.Count
        If AddIns(i).Name = addinName Then nameExists = True: Exit For
    Next i
    If nameExists Then
        AddIns(i).Installed = True
    Else
        Application.Dialogs(xlDialogAddinManager).Show
    End If
    End Sub
    If you have the full path to the addin, you could use .Add instead of calling the dialog.

  5. #5
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks. Looking for the Solver addin in 2007. I have created a custom menu and wanted to make one of the options to check for it and depending on the result if not found add it via code.

Posting Permissions

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