ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Networkdays (https://www.excelbanter.com/excel-programming/322497-networkdays.html)

broogle

Networkdays
 
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


Ron de Bruin

Networkdays
 
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



--
Regards Ron de Bruin
http://www.rondebruin.nl



"broogle" wrote in message ups.com...
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




Myrna Larson

Networkdays
 
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



On Sun, 6 Feb 2005 11:28:42 +0100, "Ron de Bruin"
wrote:

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



Ron de Bruin

Networkdays
 
Hi Myrna

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


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Myrna Larson" wrote in message ...
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



On Sun, 6 Feb 2005 11:28:42 +0100, "Ron de Bruin"
wrote:

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





Ron de Bruin

Networkdays
 
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


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Ron de Bruin" wrote in message ...
Hi Myrna

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


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Myrna Larson" wrote in message ...
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



On Sun, 6 Feb 2005 11:28:42 +0100, "Ron de Bruin"
wrote:

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








All times are GMT +1. The time now is 04:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com