Analysis Toolpak - VBA add-in

V

VBA_EE_Engr

How do I use the analysis toolpak for VBA? I loaded the add-in, but I can't
seem to find any of the functions, and it asks for a password to open the
atpvbaen project.
 
G

Gary Keramidas

you don't need to open it.

just use the functions, for example,

=eomonth(a1,1)

if a1 has a date in it
 
P

Peter T

If speed is important, eg calling the ATP multiple times, set a reference to
Atpvbaen.xls in Tools References. Otherwise use Application.Run

Sub test()
Dim start_date As Date, eom As Date
Dim months
start_date = Date
months = 12
' with a ref to the addin works fast
eom = EoMonth(start_date, months) ' with the ref
MsgBox eom

months = 1

' this works without the ref but much slower
eom = Application.Run("EoMonth", start_date, months)
MsgBox eom
End Sub

Regards,
Peter T
 

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