I need macro help

L

Littleguy

I have a excel template that uses the analysis toolpak. However not
everybody in my company has that function initiated. I need a macro
that will check when the program is opened and will tick the addin if
it is not already ticked.
 
B

Bob Phillips

With Application.AddIns("Analysis ToolPak")
If Not .Installed Then
.Installed = True
End If
End With


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 
G

Gord Dibben

You need this in the Thisworkbook module

Private Sub Workbook_Open()
AddIns("analysis toolpak").Installed = True
End Sub

And maybe this to unload when workbook close.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
AddIns("analysis toolpak").Installed = False
End Sub


Gord Dibben MS Excel MVP
 
Top