Automatically installing and running the Analysis ToolPak add-in

  • Thread starter Thread starter Mas
  • Start date Start date
M

Mas

Hi all,

I was wondering if it is at all possible to create some coding that I
can add to my worksheet that will load the Analysis ToolPak add-in (if
not already installed), activate it (so I can use one of it's
functions), automatically recalculate the worksheet and then deactivate
the add-in once my worksheet has been updated.

This would save me a lot of time manually installing the add-in
personally on every computer of the people who want to review my worksheet.

Thanks in advance

Mas
 
Here is some code by Dana deLouise that installs the solver addin. You
should be able to adapt it to the analysis toolpak:

ub SolverInstall()
'// Dana DeLouis
Dim wb As Workbook

On Error Resume Next
' Set a Reference to the workbook that will hold Solver
Set wb = ActiveWorkbook

With wb.VBProject.References
.Remove .Item("SOLVER")
End With

With AddIns("Solver Add-In")
.Installed = False
.Installed = True
wb.VBProject.References.AddFromFile .FullName
End With
End Sub

Application.Calculate

will do a calculate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top