Networkdays

  • Thread starter Thread starter broogle
  • Start date Start date
B

broogle

Hi, Can I use " AddIns("Analysis ToolPak").Installed = True"
in my macro to make AddIns Installed automatically ever time the users
open the spreadsheet?
Thanks
 
Hi

Copy it in the thisworkbook module

Private Sub Workbook_Open()
AddIns("Analysis ToolPak").Installed = True
End Sub

See Chip Pearson's site also
http://www.cpearson.com/excel/events.htm

But not everybody have this file on his machine(you must install in from the office cd)
So build in a error check

Something like this

Private Sub Workbook_Open()
On Error Resume Next
AddIns("Analysis ToolPak").Installed = True
If Err.Number > 0 Then
MsgBox "Can't install......."
Err.Clear
End If
On Error GoTo 0
End Sub
 
Hi, Ron:

Do you have a solution for the case in which the VBA code calls functions from
the ATP, such as YIELD, et al? In my experience, the code can't be compiled,
so the Workbook_Open routine can't be run. I believe that in this situation a
separate "loader" workbook that checks for the ATP has to be loaded first, and
if the ATP is there, it loads the "real" workbook and closes itself.

Myrna Larson
 
Hi Myrna

Never try it but I will see If I can find a solution
 
Hi Myrna

From a old posting from Tom.

Can't you use this in combination with the open event for the VBA add-in
You don't need the reference in the VBA editor this way.

Sub aa()
res = Application.Run("Atpvbaen.xla!Price", "2/15/91", "11/15/99", 0.0575, 0.065, 100, 2, 0)
MsgBox res
End Sub
 

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