PC Review


Reply
Thread Tools Rate Thread

How do I call Fourier Analysis in Excel2007 in a macro?

 
 
Neal Carron
Guest
Posts: n/a
 
      2nd May 2009
A 2005 thread discussed this in earlier versions of Excel, but the methods
don't work in Excel 2007.
I need to do a Fourier Transform in a macro. The macro inserts
Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False

I keep getting errors there, and the macro stops.
Can anyone help?
 
Reply With Quote
 
 
 
 
Dana DeLouis
Guest
Posts: n/a
 
      2nd May 2009
> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False

It appears your macro is missing the input and output range.
Also note that Fourier can not overwrite the output range if the output
range has data. You have to clear the output range before calling this
function.

= = =
HTH
Dana DeLouis



Neal Carron wrote:
> A 2005 thread discussed this in earlier versions of Excel, but the methods
> don't work in Excel 2007.
> I need to do a Fourier Transform in a macro. The macro inserts
> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
>
> I keep getting errors there, and the macro stops.
> Can anyone help?

 
Reply With Quote
 
Neal Carron
Guest
Posts: n/a
 
      5th May 2009
That doesn't appear to be the problem.
I've cleared the output range, and clearly inserted the input and output
ranges in the FT routine. I still get the error msg:

Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False

And I've saved the file as macro-enabled (*.xlsm).

In direct application (outside the macro) the FT will overwrite existing
data (a dialog box asks if you wish to do so).

So I still don't know how to run a FT in an Excel97 macro.
- Neal

"Dana DeLouis" wrote:

> > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False

>
> It appears your macro is missing the input and output range.
> Also note that Fourier can not overwrite the output range if the output
> range has data. You have to clear the output range before calling this
> function.
>
> = = =
> HTH
> Dana DeLouis
>
>
>
> Neal Carron wrote:
> > A 2005 thread discussed this in earlier versions of Excel, but the methods
> > don't work in Excel 2007.
> > I need to do a Fourier Transform in a macro. The macro inserts
> > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
> >
> > I keep getting errors there, and the macro stops.
> > Can anyone help?

>

 
Reply With Quote
 
Neal Carron
Guest
Posts: n/a
 
      5th May 2009
Sorry, the last sentence should have read Excel2007, not Excel97.
- Neal

"Neal Carron" wrote:

> That doesn't appear to be the problem.
> I've cleared the output range, and clearly inserted the input and output
> ranges in the FT routine. I still get the error msg:
>
> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
>
> And I've saved the file as macro-enabled (*.xlsm).
>
> In direct application (outside the macro) the FT will overwrite existing
> data (a dialog box asks if you wish to do so).
>
> So I still don't know how to run a FT in an Excel97 macro.
> - Neal
>
> "Dana DeLouis" wrote:
>
> > > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False

> >
> > It appears your macro is missing the input and output range.
> > Also note that Fourier can not overwrite the output range if the output
> > range has data. You have to clear the output range before calling this
> > function.
> >
> > = = =
> > HTH
> > Dana DeLouis
> >
> >
> >
> > Neal Carron wrote:
> > > A 2005 thread discussed this in earlier versions of Excel, but the methods
> > > don't work in Excel 2007.
> > > I need to do a Fourier Transform in a macro. The macro inserts
> > > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
> > >
> > > I keep getting errors there, and the macro stops.
> > > Can anyone help?

> >

 
Reply With Quote
 
Dana DeLouis
Guest
Posts: n/a
 
      5th May 2009
> I still get the error msg:

What error message are you getting?

If you have data in A1:A4, and C1:C4 is clear, this small demo works in
Excel 2007.

Sub Demo()
Run "ATPVBAEN.XLAM!FOURIER", Range("A1:A4"), Range("C1"), False, False

End Sub

= = =
HTH
Dana DeLouis



Neal Carron wrote:
> Sorry, the last sentence should have read Excel2007, not Excel97.
> - Neal
>
> "Neal Carron" wrote:
>
>> That doesn't appear to be the problem.
>> I've cleared the output range, and clearly inserted the input and output
>> ranges in the FT routine. I still get the error msg:
>>
>> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
>>
>> And I've saved the file as macro-enabled (*.xlsm).
>>
>> In direct application (outside the macro) the FT will overwrite existing
>> data (a dialog box asks if you wish to do so).
>>
>> So I still don't know how to run a FT in an Excel97 macro.
>> - Neal
>>
>> "Dana DeLouis" wrote:
>>
>>> > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
>>>
>>> It appears your macro is missing the input and output range.
>>> Also note that Fourier can not overwrite the output range if the output
>>> range has data. You have to clear the output range before calling this
>>> function.
>>>
>>> = = =
>>> HTH
>>> Dana DeLouis
>>>
>>>
>>>
>>> Neal Carron wrote:
>>>> A 2005 thread discussed this in earlier versions of Excel, but the methods
>>>> don't work in Excel 2007.
>>>> I need to do a Fourier Transform in a macro. The macro inserts
>>>> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
>>>>
>>>> I keep getting errors there, and the macro stops.
>>>> Can anyone help?

 
Reply With Quote
 
Neal Carron
Guest
Posts: n/a
 
      5th May 2009
Thanks. I tried your example. Still doesn't work. It says:

Run-time error '1004':
Method 'Run' of object '_Application' failed

- Neal

"Dana DeLouis" wrote:

> > I still get the error msg:

>
> What error message are you getting?
>
> If you have data in A1:A4, and C1:C4 is clear, this small demo works in
> Excel 2007.
>
> Sub Demo()
> Run "ATPVBAEN.XLAM!FOURIER", Range("A1:A4"), Range("C1"), False, False
>
> End Sub
>
> = = =
> HTH
> Dana DeLouis
>
>
>
> Neal Carron wrote:
> > Sorry, the last sentence should have read Excel2007, not Excel97.
> > - Neal
> >
> > "Neal Carron" wrote:
> >
> >> That doesn't appear to be the problem.
> >> I've cleared the output range, and clearly inserted the input and output
> >> ranges in the FT routine. I still get the error msg:
> >>
> >> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
> >>
> >> And I've saved the file as macro-enabled (*.xlsm).
> >>
> >> In direct application (outside the macro) the FT will overwrite existing
> >> data (a dialog box asks if you wish to do so).
> >>
> >> So I still don't know how to run a FT in an Excel97 macro.
> >> - Neal
> >>
> >> "Dana DeLouis" wrote:
> >>
> >>> > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
> >>>
> >>> It appears your macro is missing the input and output range.
> >>> Also note that Fourier can not overwrite the output range if the output
> >>> range has data. You have to clear the output range before calling this
> >>> function.
> >>>
> >>> = = =
> >>> HTH
> >>> Dana DeLouis
> >>>
> >>>
> >>>
> >>> Neal Carron wrote:
> >>>> A 2005 thread discussed this in earlier versions of Excel, but the methods
> >>>> don't work in Excel 2007.
> >>>> I need to do a Fourier Transform in a macro. The macro inserts
> >>>> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
> >>>>
> >>>> I keep getting errors there, and the macro stops.
> >>>> Can anyone help?

>

 
Reply With Quote
 
Dana DeLouis
Guest
Posts: n/a
 
      5th May 2009
> Run-time error '1004':
> Method 'Run' of object '_Application' failed


Ok. Try this in Excel 2007

Office Button...
Excel Options (Near bottom)
Add-Ins (On Left)
Manage: Excel Add-ins ...click "Go" (Near Bottom)

Make Sure
Analysis Toolpak
and
Analysis Toolpak - VBA

are both selected.

I think it should work now, but I'm guessing...


Just a Note:

When you write..
> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False


One can not tell the size of your input range. Fourier works in 2^k
size, so it is hard to tell if the size of your input range was not correct.

Manually, Excel will overwrite the data as you mentioned...I was just
mentioning the "bug" that has been around a while in that vba generates
an error if the output range has data. The output range must be cleared
first. Why this has not been fixed yet...I have no idea. :>(

= = = =
HTH :>)
Dana DeLouis




Neal Carron wrote:
> Thanks. I tried your example. Still doesn't work. It says:
>
> Run-time error '1004':
> Method 'Run' of object '_Application' failed
>
> - Neal
>
> "Dana DeLouis" wrote:
>
>> > I still get the error msg:

>>
>> What error message are you getting?
>>
>> If you have data in A1:A4, and C1:C4 is clear, this small demo works in
>> Excel 2007.
>>
>> Sub Demo()
>> Run "ATPVBAEN.XLAM!FOURIER", Range("A1:A4"), Range("C1"), False, False
>>
>> End Sub
>>
>> = = =
>> HTH
>> Dana DeLouis
>>
>>
>>
>> Neal Carron wrote:
>>> Sorry, the last sentence should have read Excel2007, not Excel97.
>>> - Neal
>>>
>>> "Neal Carron" wrote:
>>>
>>>> That doesn't appear to be the problem.
>>>> I've cleared the output range, and clearly inserted the input and output
>>>> ranges in the FT routine. I still get the error msg:
>>>>
>>>> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
>>>>
>>>> And I've saved the file as macro-enabled (*.xlsm).
>>>>
>>>> In direct application (outside the macro) the FT will overwrite existing
>>>> data (a dialog box asks if you wish to do so).
>>>>
>>>> So I still don't know how to run a FT in an Excel97 macro.
>>>> - Neal
>>>>
>>>> "Dana DeLouis" wrote:
>>>>
>>>>> > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
>>>>>
>>>>> It appears your macro is missing the input and output range.
>>>>> Also note that Fourier can not overwrite the output range if the output
>>>>> range has data. You have to clear the output range before calling this
>>>>> function.
>>>>>
>>>>> = = =
>>>>> HTH
>>>>> Dana DeLouis
>>>>>
>>>>>
>>>>>
>>>>> Neal Carron wrote:
>>>>>> A 2005 thread discussed this in earlier versions of Excel, but the methods
>>>>>> don't work in Excel 2007.
>>>>>> I need to do a Fourier Transform in a macro. The macro inserts
>>>>>> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
>>>>>>
>>>>>> I keep getting errors there, and the macro stops.
>>>>>> Can anyone help?

 
Reply With Quote
 
Neal Carron
Guest
Posts: n/a
 
      5th May 2009
Aaaahhhh. You're a genius.
Analysis Toolpak was activated, but
Analysis Toolpak - VBA was not.
Works fine now.
"Mystery is always annoying, and is usually due to lack of clear analysis" -
Bertram Russel.

Thanks.
- Neal


"Dana DeLouis" wrote:

> > Run-time error '1004':
> > Method 'Run' of object '_Application' failed

>
> Ok. Try this in Excel 2007
>
> Office Button...
> Excel Options (Near bottom)
> Add-Ins (On Left)
> Manage: Excel Add-ins ...click "Go" (Near Bottom)
>
> Make Sure
> Analysis Toolpak
> and
> Analysis Toolpak - VBA
>
> are both selected.
>
> I think it should work now, but I'm guessing...
>
>
> Just a Note:
>
> When you write..
> > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False

>
> One can not tell the size of your input range. Fourier works in 2^k
> size, so it is hard to tell if the size of your input range was not correct.
>
> Manually, Excel will overwrite the data as you mentioned...I was just
> mentioning the "bug" that has been around a while in that vba generates
> an error if the output range has data. The output range must be cleared
> first. Why this has not been fixed yet...I have no idea. :>(
>
> = = = =
> HTH :>)
> Dana DeLouis
>
>
>
>
> Neal Carron wrote:
> > Thanks. I tried your example. Still doesn't work. It says:
> >
> > Run-time error '1004':
> > Method 'Run' of object '_Application' failed
> >
> > - Neal
> >
> > "Dana DeLouis" wrote:
> >
> >> > I still get the error msg:
> >>
> >> What error message are you getting?
> >>
> >> If you have data in A1:A4, and C1:C4 is clear, this small demo works in
> >> Excel 2007.
> >>
> >> Sub Demo()
> >> Run "ATPVBAEN.XLAM!FOURIER", Range("A1:A4"), Range("C1"), False, False
> >>
> >> End Sub
> >>
> >> = = =
> >> HTH
> >> Dana DeLouis
> >>
> >>
> >>
> >> Neal Carron wrote:
> >>> Sorry, the last sentence should have read Excel2007, not Excel97.
> >>> - Neal
> >>>
> >>> "Neal Carron" wrote:
> >>>
> >>>> That doesn't appear to be the problem.
> >>>> I've cleared the output range, and clearly inserted the input and output
> >>>> ranges in the FT routine. I still get the error msg:
> >>>>
> >>>> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
> >>>>
> >>>> And I've saved the file as macro-enabled (*.xlsm).
> >>>>
> >>>> In direct application (outside the macro) the FT will overwrite existing
> >>>> data (a dialog box asks if you wish to do so).
> >>>>
> >>>> So I still don't know how to run a FT in an Excel97 macro.
> >>>> - Neal
> >>>>
> >>>> "Dana DeLouis" wrote:
> >>>>
> >>>>> > Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
> >>>>>
> >>>>> It appears your macro is missing the input and output range.
> >>>>> Also note that Fourier can not overwrite the output range if the output
> >>>>> range has data. You have to clear the output range before calling this
> >>>>> function.
> >>>>>
> >>>>> = = =
> >>>>> HTH
> >>>>> Dana DeLouis
> >>>>>
> >>>>>
> >>>>>
> >>>>> Neal Carron wrote:
> >>>>>> A 2005 thread discussed this in earlier versions of Excel, but the methods
> >>>>>> don't work in Excel 2007.
> >>>>>> I need to do a Fourier Transform in a macro. The macro inserts
> >>>>>> Application.Run "ATPVBAEN.XLAM!Fourier", , , False, False
> >>>>>>
> >>>>>> I keep getting errors there, and the macro stops.
> >>>>>> Can anyone help?

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: Automate the Fourier Analysis - Data Analysis Tool pinkpanther Microsoft Excel Discussion 0 14th Jan 2011 04:04 PM
How can I call Fourier Analysis from a Visual Basic macro? =?Utf-8?B?QmFydGhvZw==?= Microsoft Excel Programming 3 17th Oct 2005 02:33 PM
Fourier Analysis =?Utf-8?B?am9yZG9u?= Microsoft Excel Worksheet Functions 3 18th Aug 2005 11:17 PM
Fourier Analysis guru Microsoft Excel Worksheet Functions 2 11th Dec 2003 10:34 PM
fourier analysis guru Microsoft Excel Worksheet Functions 1 9th Dec 2003 05:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:16 AM.