+ Reply to Thread
Results 1 to 4 of 4

How can I call Fourier Analysis from a Visual Basic macro?

  1. #1
    Barthog
    Guest

    How can I call Fourier Analysis from a Visual Basic macro?

    I recorded a macro in Excel that included using the Fourier Analysis tool
    from the VBA Analysis ToolPak, but when I ran the macro, I got an error
    saying the input range was not defined. When I recorded the macro, I had
    entered an input range, so I examined the macro code. I didn't see my input
    range in the code, but I realised I didn't know how the Fourier Analysis
    application had to be called from Visual Basic anyway.

    The macro recorder had inserted the line:
    Application.Run "ATPVBAEN.XLA!Fourier", , , False, False
    for forward Fourier transformation, and
    Application.Run "ATPVBAEN.XLA!Fourier", , , True, False
    for inverse Fourier transformaiton.

    Can anyone who has used the Fourier Analysis tool from Visual Basic help me
    by describing the syntax for calling Fourier Analysis (ATPVBAEN.XLA!Fourier)?

    Many thanks.

  2. #2
    Dave Peterson
    Guest

    Re: How can I call Fourier Analysis from a Visual Basic macro?

    It looks like it goes in this order:
    input_Range,output_range,inverse,labels_in_first_row

    When I recorded a macro and selected a couple of ranges, I got:

    Application.Run "ATPVBAEN.XLA!Fourier", ActiveSheet.Range("$A$1:$A$8"), _
    ActiveSheet.Range("$B$1:$F$7"), False, False


    Barthog wrote:
    >
    > I recorded a macro in Excel that included using the Fourier Analysis tool
    > from the VBA Analysis ToolPak, but when I ran the macro, I got an error
    > saying the input range was not defined. When I recorded the macro, I had
    > entered an input range, so I examined the macro code. I didn't see my input
    > range in the code, but I realised I didn't know how the Fourier Analysis
    > application had to be called from Visual Basic anyway.
    >
    > The macro recorder had inserted the line:
    > Application.Run "ATPVBAEN.XLA!Fourier", , , False, False
    > for forward Fourier transformation, and
    > Application.Run "ATPVBAEN.XLA!Fourier", , , True, False
    > for inverse Fourier transformaiton.
    >
    > Can anyone who has used the Fourier Analysis tool from Visual Basic help me
    > by describing the syntax for calling Fourier Analysis (ATPVBAEN.XLA!Fourier)?
    >
    > Many thanks.


    --

    Dave Peterson

  3. #3
    Barthog
    Guest

    Re: How can I call Fourier Analysis from a Visual Basic macro?

    Thanks, Dave. That worked. In fact, I tried putting Range(...) into the two
    spaces in the calling line, but the syntax I used wasn't what you put in your
    reply, so it seems to matter how Range is used.

    "Dave Peterson" wrote:

    > It looks like it goes in this order:
    > input_Range,output_range,inverse,labels_in_first_row
    >
    > When I recorded a macro and selected a couple of ranges, I got:
    >
    > Application.Run "ATPVBAEN.XLA!Fourier", ActiveSheet.Range("$A$1:$A$8"), _
    > ActiveSheet.Range("$B$1:$F$7"), False, False
    >
    >
    > Barthog wrote:
    > >
    > > I recorded a macro in Excel that included using the Fourier Analysis tool
    > > from the VBA Analysis ToolPak, but when I ran the macro, I got an error
    > > saying the input range was not defined. When I recorded the macro, I had
    > > entered an input range, so I examined the macro code. I didn't see my input
    > > range in the code, but I realised I didn't know how the Fourier Analysis
    > > application had to be called from Visual Basic anyway.
    > >
    > > The macro recorder had inserted the line:
    > > Application.Run "ATPVBAEN.XLA!Fourier", , , False, False
    > > for forward Fourier transformation, and
    > > Application.Run "ATPVBAEN.XLA!Fourier", , , True, False
    > > for inverse Fourier transformaiton.
    > >
    > > Can anyone who has used the Fourier Analysis tool from Visual Basic help me
    > > by describing the syntax for calling Fourier Analysis (ATPVBAEN.XLA!Fourier)?
    > >
    > > Many thanks.

    >
    > --
    >
    > Dave Peterson
    >


  4. #4
    Dana DeLouis
    Guest

    Re: How can I call Fourier Analysis from a Visual Basic macro?

    Also note that the Fourier program only looks at the upper left corner of
    the output range address.

    Sub SmallDemo()
    Const FFT As String = "ATPVBAEN.XLA!Fourier"
    Const Forward As Boolean = False

    Run FFT, [A1:A8], [B1], Forward
    End Sub

    :>)
    --
    Dana DeLouis
    Win XP & Office 2003


    "Barthog" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks, Dave. That worked. In fact, I tried putting Range(...) into the
    > two
    > spaces in the calling line, but the syntax I used wasn't what you put in
    > your
    > reply, so it seems to matter how Range is used.
    >
    > "Dave Peterson" wrote:
    >
    >> It looks like it goes in this order:
    >> input_Range,output_range,inverse,labels_in_first_row
    >>
    >> When I recorded a macro and selected a couple of ranges, I got:
    >>
    >> Application.Run "ATPVBAEN.XLA!Fourier",
    >> ActiveSheet.Range("$A$1:$A$8"), _
    >> ActiveSheet.Range("$B$1:$F$7"), False, False
    >>
    >>
    >> Barthog wrote:
    >> >
    >> > I recorded a macro in Excel that included using the Fourier Analysis
    >> > tool
    >> > from the VBA Analysis ToolPak, but when I ran the macro, I got an error
    >> > saying the input range was not defined. When I recorded the macro, I
    >> > had
    >> > entered an input range, so I examined the macro code. I didn't see my
    >> > input
    >> > range in the code, but I realised I didn't know how the Fourier
    >> > Analysis
    >> > application had to be called from Visual Basic anyway.
    >> >
    >> > The macro recorder had inserted the line:
    >> > Application.Run "ATPVBAEN.XLA!Fourier", , , False, False
    >> > for forward Fourier transformation, and
    >> > Application.Run "ATPVBAEN.XLA!Fourier", , , True, False
    >> > for inverse Fourier transformaiton.
    >> >
    >> > Can anyone who has used the Fourier Analysis tool from Visual Basic
    >> > help me
    >> > by describing the syntax for calling Fourier Analysis
    >> > (ATPVBAEN.XLA!Fourier)?
    >> >
    >> > Many thanks.

    >>
    >> --
    >>
    >> Dave Peterson
    >>




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1