ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet function - array result, C++ (https://www.excelbanter.com/excel-programming/431602-worksheet-function-array-result-c.html)

kamil jaskiewicz

Worksheet function - array result, C++
 
Hi All,

I'd like to use C++ to:
1. Write addin which exposes function available from worksheet
2. Function has one parameter which is a query to database returning data
(size of data in unknown until query is launched)
3. Insert result into cells.

I've been trying with Excel and COM addins and I can't write results to
cells when I call function. The problem doesn't exists when it is a macro.
Then I can write to any cell on the sheet.

Is it possible to handle it in a different way?

Any help would be much appreciated.

Thanks
Kamil.


Charles Williams

Worksheet function - array result, C++
 
Functions can only return results to the cells they occupy:
If you array-enter (Control-Shift-Enter) a Function into multiple cells then
the function can return an array of values to those cells.

Otherwise you have to use a Sub called from an event.


--
Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com


"kamil jaskiewicz" wrote in
message ...
Hi All,

I'd like to use C++ to:
1. Write addin which exposes function available from worksheet
2. Function has one parameter which is a query to database returning data
(size of data in unknown until query is launched)
3. Insert result into cells.

I've been trying with Excel and COM addins and I can't write results to
cells when I call function. The problem doesn't exists when it is a macro.
Then I can write to any cell on the sheet.

Is it possible to handle it in a different way?

Any help would be much appreciated.

Thanks
Kamil.





kamil jaskiewicz

Worksheet function - array result, C++
 
Thanks Charles,

I don't want to use array formulas because it is not convenient way (you
don't know what range you have to select). I'll try with events.

"Charles Williams" wrote:

Functions can only return results to the cells they occupy:
If you array-enter (Control-Shift-Enter) a Function into multiple cells then
the function can return an array of values to those cells.

Otherwise you have to use a Sub called from an event.


--
Charles
___________________________________
The Excel Calculation Site
http://www.decisionmodels.com




All times are GMT +1. The time now is 01:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com