Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fourier Calculation (Excel)

Status
Not open for further replies.

VBAva

Programmer
Jul 29, 2003
87
IE
when recorded in a macro, the command to run a fourier calculation is
Application.Run "ATPVBAEN.XLA!Fourier", ......
but when this is played back it gives the error
Run-Time Error '1004':
'ATPVBAEN.XLA' could not be found. Check the spelling of the file name, and verify that the file location is correct.

How can i run this addin from code??

thank you in advance
:)
 
Check the spelling of the file name, and verify that the file location is correct

Could you change Application.Run "ATPVBAEN.XLA!Fourier" to Application.Run "Path_of_AddIn\ATPVBAEN.XLA!Fourier"

Does this help!



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Try checking the box for SOLVER in the VBA editor under Tools>References. I'm not sure if the Fourier Series is part of the solver package or not but it's worth a try.

Ben
 
hey Mike

When i use the full path for the add in i get
The macro C:\Program Files\Microsoft Office\Office\Library\Analysis\ATPVBAEN.XLA!Fourier cannot be found.

Ben
I tried to add it in as a Reference. now there is no error but i just does nothing. :-/ very strange.

This gives me no error but does nothing! apart from show the text box.
any thoughts? it has me confused.

Application.Run "ATPVBAEN.XLA!Fourier", ActiveSheet.Range("$B$6:$B$37"), ActiveSheet.Range("$D$6"), False, False
MsgBox "Fourier"

thanks for the help
:)
 
If your Add-in is installed (Tools->Add-ins...) then you don't have to call the procedure like this anyway. Check to see if the "Fourier" function is set to Private.

If the "Fourier" function is not a custom function, but one of the Built-in functions of a MS Add-in (I have never heard of this function), then check the syntax for this function.



Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Mystery solved :)

The Fourier calculation function is part of the 'Analysis ToolPak' Add-In.
It can be called using
Application.Run "ATPVBAEN.XLA!Fourier", .....
in VBA code, BUT the 'Analysis Toolpak - VBA' Add-In must also be, well, added in.

I hope this helps some one other than me :)

thanks Mike :)
 
Glad I could help!

[wavey]

Peace! [peace]

Mike

Never say Never!!!
Nothing is impossible!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top