How to operate an add-in from VBA

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?
 
F

Frank Kabel

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?
 
L

LB

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.
 

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