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.
<PRE>
<FONT color=blue>Sub </FONT>Create_Reference_()
<FONT color=#ff0000> 'You need to set a reference to Microsoft Visual Basic for Applications Extensibility 5.3
</FONT>
<FONT color=#ff0000> 'via Tools | Reference
</FONT>
<FONT color=blue>Dim </FONT>oVBReferens<FONT color=blue> As</FONT> VBIDE.Reference
<FONT color=blue>Dim </FONT>wbBok<FONT color=blue> As</FONT><FONT color=blue> Workbook</FONT>
<FONT color=blue>Set </FONT>wbBok = ThisWorkbook
<FONT color=blue>On Error</FONT> <FONT color=blue>Resume </FONT>Next
<FONT color=blue>Set </FONT>oVBReferens = wbBok.VBProject.References("atpvbaen")
<FONT color=blue>If </FONT>oVBReferens Is<FONT color=blue> Nothing</FONT> Then
wbBok.VBProject.References.AddFromFile _
Application.AddIns("Analysis ToolPak - VBA").FullName
MsgBox "Reference created to this project."
<FONT color=blue>Else</FONT>
MsgBox "Reference already exist."
<FONT color=blue>End If</FONT>
<FONT color=blue>End Sub</FONT>
</PRE>
HTH,
Dennis