Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default "Reference is not Valid" when calling fast fourier transform

Hello. I get the message "Reference is not Valid" when the following piece
of code executes from my program; k is an integer, focallength is a double,
and sheetname is a string:

sheetname = "r32-" & k + 1 & "-" & FocalLength

Dim infourierrng As Range
Dim outfourierrng As Range

Set infourierrng = Worksheets(sheetname).Range("J15:J1038")
Set outfourierrng = Worksheets(sheetname).Range("L15:L1038")

Application.Run "ATPVBAEN.XLA!Fourier", infourierrng, outfourierrng, False,
False

This message appears in a messagebox; if I click OK, everything proceeds
fine, and the fourier transform works, so it isn't really much of a problem,
except I don't want this message to appear anytime anyone runs this macro.
Any help would be greatly appreciated.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default "Reference is not Valid" when calling fast fourier transform

Seems like the issue occurs somewhere within the external procedure
"ATPVBAEN.XLA!Fourier. Without knowing the code behind that procedure there
is no way to know why the messagebox appears or how to prevent it.

--
- K Dales


"JacksonRJones" wrote:

Hello. I get the message "Reference is not Valid" when the following piece
of code executes from my program; k is an integer, focallength is a double,
and sheetname is a string:

sheetname = "r32-" & k + 1 & "-" & FocalLength

Dim infourierrng As Range
Dim outfourierrng As Range

Set infourierrng = Worksheets(sheetname).Range("J15:J1038")
Set outfourierrng = Worksheets(sheetname).Range("L15:L1038")

Application.Run "ATPVBAEN.XLA!Fourier", infourierrng, outfourierrng, False,
False

This message appears in a messagebox; if I click OK, everything proceeds
fine, and the fourier transform works, so it isn't really much of a problem,
except I don't want this message to appear anytime anyone runs this macro.
Any help would be greatly appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default "Reference is not Valid" when calling fast fourier transform

ATPVBAEN.XLA!Fourier is part of the standard analysis toolpack that comes
with with excel 2003. It can be accessed from the tools-data analysis menu
in excel. I think the problem has something to do with using the sheetname
as a variable, because I did not get this error message when I was just using
"sheet1" in place of the variable sheetname. Anyways, maybe this will help
someone figure out what the problem is. Thanks.

"K Dales" wrote:

Seems like the issue occurs somewhere within the external procedure
"ATPVBAEN.XLA!Fourier. Without knowing the code behind that procedure there
is no way to know why the messagebox appears or how to prevent it.

--
- K Dales


"JacksonRJones" wrote:

Hello. I get the message "Reference is not Valid" when the following piece
of code executes from my program; k is an integer, focallength is a double,
and sheetname is a string:

sheetname = "r32-" & k + 1 & "-" & FocalLength

Dim infourierrng As Range
Dim outfourierrng As Range

Set infourierrng = Worksheets(sheetname).Range("J15:J1038")
Set outfourierrng = Worksheets(sheetname).Range("L15:L1038")

Application.Run "ATPVBAEN.XLA!Fourier", infourierrng, outfourierrng, False,
False

This message appears in a messagebox; if I click OK, everything proceeds
fine, and the fourier transform works, so it isn't really much of a problem,
except I don't want this message to appear anytime anyone runs this macro.
Any help would be greatly appreciated.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default "Reference is not Valid" when calling fast fourier transform

In case anyone reads this, I ended up fixing this problem by activating the
worksheet which had the data I wanted to do the fft on and then defining the
range for the active worksheet, then referring this range for the fft:

Worksheets(sheetname).Activate

Set infourierrng = Range("J15:J1038")
Set outfourierrng = Range("L15:L1038")

Application.Run "ATPVBAEN.XLA!Fourier", infourierrng, outfourierrng, False,
False


"JacksonRJones" wrote:

Hello. I get the message "Reference is not Valid" when the following piece
of code executes from my program; k is an integer, focallength is a double,
and sheetname is a string:

sheetname = "r32-" & k + 1 & "-" & FocalLength

Dim infourierrng As Range
Dim outfourierrng As Range

Set infourierrng = Worksheets(sheetname).Range("J15:J1038")
Set outfourierrng = Worksheets(sheetname).Range("L15:L1038")

Application.Run "ATPVBAEN.XLA!Fourier", infourierrng, outfourierrng, False,
False

This message appears in a messagebox; if I click OK, everything proceeds
fine, and the fourier transform works, so it isn't really much of a problem,
except I don't want this message to appear anytime anyone runs this macro.
Any help would be greatly appreciated.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Analysis ToolPaks VBA Fast Fourier Transform Dimitry Excel Discussion (Misc queries) 7 April 30th 23 03:44 AM
Pivot Table "Data source reference is not valid" error cause? Bill Neurohr Excel Discussion (Misc queries) 1 March 11th 09 10:16 PM
Fast Fourier Transform outputs in Excel custardcream13 Excel Worksheet Functions 1 September 12th 07 05:20 AM
Fast Fourier Transform routine in Tools add-in menu Tutorguy Excel Worksheet Functions 1 March 23rd 06 04:49 PM
Fast Fourier Transform Ad Pronk Excel Worksheet Functions 0 May 12th 05 11:38 AM


All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"