adding Add-ins

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: adding Add-ins

  1. #1
    Board Regular
    Join Date
    Jun 2002
    Location
    Minneapolis
    Posts
    71
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    is it possible (and if so how) to have a workbook upon opening to check if a certain Add-in is selected and if not select it?

    I need the Analysis ToolPak and Analysis ToolPak VBA to be on.

  2. #2
    Board Regular XL-Dennis's Avatar
    Join Date
    Jul 2002
    Location
    Östersund, Sweden
    Posts
    1,920
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    dbrull,

    Following code create a reference to A/T VBA in Your VBA-project.

    However, the code does not check wether the add-in is installed on the computer or not.


    Sub Create_Reference_()

    'You need to set a reference to Microsoft Visual Basic for Applications Extensibility 5.3

    'via Tools | Reference

    Dim oVBReferens As VBIDE.Reference

    Dim wbBok As Workbook

    Set wbBok = ThisWorkbook



    On Error Resume Next



    Set oVBReferens = wbBok.VBProject.References("atpvbaen")



    If oVBReferens Is Nothing Then

    wbBok.VBProject.References.AddFromFile _

    Application.AddIns("Analysis ToolPak - VBA").FullName

    MsgBox "Reference created to this project."

    Else

    MsgBox "Reference already exist."

    End If

    End Sub












    HTH,
    Dennis
    Kind regards,
    Dennis

    Developing solutions with B4J and B4A

  3. #3
    Board Regular
    Join Date
    Jun 2002
    Location
    Minneapolis
    Posts
    71
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    thanks

    i get a message that says "User Defined type not Defined"

    and oVBReferens is highlighted.

    any ideas?

  4. #4
    MrExcel MVP Joe Was's Avatar
    Join Date
    Feb 2002
    Location
    Central Florida, USA
    Posts
    7,539
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default

    You need to set an outside reference to Excel. To do this from the VBA editor click: Tools-References, check the reference. This window is not much help and I myself have difficulty determining which reference to set? JSW
    JSW: Try and try again: "The way of the Coder!"

  5. #5
    New Member
    Join Date
    Aug 2002
    Location
    East Yorkshire, England
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    I use the following without requiring the extra reference.

    Function IsAddinLoaded() As Boolean
    On Error GoTo NotInstalled
    If AddIns("Conditional Sum Wizard").Installed = False Then
    IsAddinLoaded = False
    End If
    If AddIns("Conditional Sum Wizard").Installed = True Then
    IsAddinLoaded = True
    Exit Function
    End If
    NotInstalled:
    IsAddinLoaded = False
    End Function

    HTH

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com