Worksheet function - array result, C++

  • Thread starter Thread starter kamil jaskiewicz
  • Start date Start date
K

kamil jaskiewicz

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.
 
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.
 
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.
 
Back
Top