Worksheet function - array result, C++

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.
 
C

Charles Williams

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.
 
K

kamil jaskiewicz

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top