Consulting

Results 1 to 4 of 4

Thread: Code to install addin feature

  1. #1

    Code to install addin feature

    I am using the following code install Analysis toolpak adin, if not installed and calling the same on WB open event:
    Sub InstalAddin()
        If AddIns("Analysis ToolPak").Installed = False Then
            AddIns("Analysis ToolPak").Installed = True
        End If
    End Sub
    Now if the addin feature is not installed on the computer the code throws an error (Image1 attached)
    Then I have to move to tools\Addins\ ticked Analysis toolpak
    Then it asks for installing the addin feature (Image2 attached)

    Now I want to know how can I modify the ode so that if the addin feature is not at all installed on the macjine the code will install the feature and that it will not throw an error?

  2. #2
    VBAX Mentor tpoynton's Avatar
    Joined
    Feb 2005
    Location
    Clinton, MA
    Posts
    399
    Location
    when I've gotten the second error message, I've needed the Office CD to install the needed feature; is that the case here? if so, I'm pretty sure silently installing it is not possible.

  3. #3
    No in my case no office CD was needed. On clicking yes, it installed automatically.

  4. #4
    VBAX Regular
    Joined
    Nov 2006
    Posts
    16
    Location
    Without testing, you might look through all the known addins and then test if the addin name = "Analysis ToolPak" and set a boolean value to true if found
    That way you test without specially refering to the nominated 'Addin' and avoid an error if the nominated addin does not exist
    Greg

Posting Permissions

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