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.
Re: Problem in calling Excel Run fucntion from VC++
Quote:
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=
Re: Problem in calling Excel Run fucntion from VC++
Quote:
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..
:)
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:
Quote:
This means that the selection must be a single cell or the selection must be a rectangular area, not multiple unconnected areas
Re: Problem in calling Excel Run fucntion from VC++
Quote:
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.
Re: Problem in calling Excel Run fucntion from VC++
Quote:
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? :rolleyes:
The code snippet you have posted doesn't show how "contiguous" this area is!
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
Re: Problem in calling Excel Run fucntion from VC++
Quote:
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.