Thread: Automate Add-in
View Single Post
  #3   Report Post  
dominicb
 
Posts: n/a
Default


Good evening Gary's Student

This should work Ok - basically a pair of macros that open run on
opening and closing to start the add in and uninstall it if it was
uninstalled to begin with. Usual bug bear applies in that the user
must reply yes to macros being run.

Dim status

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If status = "No" Then
AddIns("Analysis ToolPak").Installed = False
End If
End Sub

Private Sub Workbook_Open()
If AddIns("Analysis ToolPak").Installed = True Then
status = "Yes"
Else
status = "No"
End If
On Error Resume Next
AddIns("Analysis ToolPak").Installed = True
End Sub

just copy this into the ThisWorkbook pane to utilise it.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=380388