How can I use Analysis Toll Pack functions in VBA?

  • Thread starter =?iso-8859-1?Q?Torbj=F6rn_Lindstr=F6m?=
  • Start date
?

=?iso-8859-1?Q?Torbj=F6rn_Lindstr=F6m?=

I like to build functions that calls Analysis Tool Pack
functins like YEARFRAC() and YIELD(). I have the add-
in "Analysis Tool Pack - VBA" (atpvbaen.xls) and Excel
2002.

I can not get it to work by using:
Application.WorksheetFunctions...
 
L

Leo Heuser

Torbjörn

Try this setup (here with the function MROUND()):

Sub test()
MsgBox Evaluate("mround(1.3, 0.2)")
End Sub
 
J

jacob

Hi,
Presume you vant to use it in VB code: Under Tools in
the VB editor select References and hook off 'atpvbaen'
and 'funcres' this will give you access to the analysis
toolpak. Typing for instance Random will make vb come up
with required call parameters.

jacob
 
M

Myrna Larson

YEARFRAC and YIELD aren't worksheet functions. They are functions in the
Analysis Tool Pak. Worksheet functions refer to things built into Excel
proper, like SUM, AVERAGE, RANK, etc, that don't require add-ins.

Once you've set a reference to the ATP in your VBA project, you can call the
function simply as

x = Yield(.....)
 

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

Top