-
November 9th, 2009, 01:01 AM
#1
Problem in calling Excel Run fucntion from VC++
Hi,
i have a problem in calling excel Fourier analysis functions from vc++.
the below line gives a error while running.
the error rises in excel sheet.
Code:
mp_application->Run("ATPVBAEN.XLA!Fourier",
(const variant_t)p_work_sheet->GetRange(p_range_pointer->Item[dw_dest_row1][dw_dest_col1],p_range_pointer->Item[dw_dest_row1][dw_dest_col1]),
(const variant_t)p_work_sheet->GetRange(p_range_pointer->Item[dw_dest_row1][dw_dest_col1],p_range_pointer->Item[dw_dest_row1][dw_dest_col1]),
false,false);
ERROR is : fourier analysis - input range must be contagious reference.
mp_application is a Excel::_ApplicationPtr
p_work_sheet is a Excel::_WorksheetPtr
please help me in finding out, what mistake i am doing while sending the parameters.
help is highly applicable.
thanks in advance.
- satya.
-
November 9th, 2009, 03:26 AM
#2
Re: Problem in calling Excel Run fucntion from VC++
Originally Posted by lion.king
ERROR is : fourier analysis - input range must be contagious reference.
...
please help me in finding out, what mistake i am doing while sending the parameters.
"contagious" or "contigious"?
If the latter - then http://www.google.com/search?hl=en&r...&aq=f&oq=&aqi=
Victor Nijegorodov
-
November 9th, 2009, 03:46 AM
#3
Re: Problem in calling Excel Run fucntion from VC++
Originally Posted by VictorN
it is contigious .. i searched in Google...they show code which is written or generated from macro recorder. but my code is in VC++. it has some thing to do with parametres ..which it is not able to match..
-
November 9th, 2009, 04:13 AM
#4
Re: Problem in calling Excel Run fucntion from VC++
The first link ( http://www.mrexcel.com/forum/showthread.php?t=35738 ) from the Google Search I referred to in my previous post explains you very clear the most possible reason of this message:
This means that the selection must be a single cell or the selection must be a rectangular area, not multiple unconnected areas
Victor Nijegorodov
-
November 9th, 2009, 07:23 AM
#5
Re: Problem in calling Excel Run fucntion from VC++
Originally Posted by VictorN
reply is highly appreciated. i got what it is saying. but i am not able to understand why it is giving the error even if i send the contiguous area.
-
November 9th, 2009, 08:20 AM
#6
Re: Problem in calling Excel Run fucntion from VC++
Originally Posted by lion.king
reply is highly appreciated. i got what it is saying. but i am not able to understand why it is giving the error even if i send the contiguous area.
Perhaps, it is NOT contiguous enough?
The code snippet you have posted doesn't show how "contiguous" this area is!
Victor Nijegorodov
-
November 9th, 2009, 08:56 AM
#7
Re: Problem in calling Excel Run fucntion from VC++
Code:
(const variant_t)p_work_sheet->GetRange(p_range_pointer->Item[dw_dest_row1][dw_dest_col1],p_range_pointer->Item[dw_dest_row1][dw_dest_col1]),
(const variant_t)p_work_sheet->GetRange(p_range_pointer->Item[dw_dest_row1][dw_dest_col1],p_range_pointer->Item[dw_dest_row1][dw_dest_col1]),
This doesn't look like a range to me, more like a single cell.
fourier analysis doesn't work well with only one value.
Kurt
-
November 18th, 2009, 04:25 AM
#8
Re: Problem in calling Excel Run fucntion from VC++
Originally Posted by ZuK
This doesn't look like a range to me, more like a single cell.
fourier analysis doesn't work well with only one value.
getrange function converts the given col and row number to range pointers. so i think i am passing range pointer only.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|