How to operate an add-in from VBA

  • Thread starter Thread starter LB
  • Start date Start date
L

LB

I have the Analysis Tool Pack add-in, ATPVBAEN.xls. I'm trying to
operate the Fourier portion from VBA so I don't have to bother with
entering input and output ranges all the time. I'd like to write
something like: ATPVBAEN.xls.Fourier(U22:U4117,V22:V4117) in VBA and
have it run. Is there a way to do this?
 
Hi
Set a reference to the Analysis toolpak, APTVBAEN.XLA and then simply
call the functions like

x = fourier(Range("U22:U4117"),Range("V22:V4117"))

Though to be honest i haven't found a FOURIER function in my function
list?
 
Hey, thanks Frank from Frankfurt. What I finally settled on was the
following:

Sub FFT()
Dim Tmp As Variant
Tmp = ActiveCell.Address
Application.ScreenUpdating = False
Range("V22:V4117").ClearContents
Application.Run "ATPVBAEN.XLA!Fourier", Range("U22:U4117"),
_Range("V22:V4117"), False, False
Application.ScreenUpdating = True
Range(Tmp).Activate
End Sub

Before running this macro it is important to ensure that the
ATPVBAEN.xla is loaded into Excel, evidenced by seeing it in the Project
Explorer of the VBA Editor.

In order to see what's inside of ATPVBAEN.xla after loading it, select
it in Project Explorer, then select atpvbaen.xls in the Object Browser
Project/Library drop-down list.
 
Back
Top