cant pass array to excel from c++ using xloper structure

M

malayhk

i tried a lot to pass array to excel sheet using xloper structure hear is
sample function i wrote to pass array using xloper

__declspec(dllexport) LPXLOPER xarr ()
{

static XLOPER xlArray;
XLOPER xlValues[4];
int i;
for (i = 0; i < 4; ++i)
{
carr=i*2;
xlValues.val.num = i+10;
xlValues.xltype = xltypeNum;
}
//this will generate array with 4 element 10,11,12,13

xlArray.xltype = xltypeMulti;
xlArray.val.array.lparray = &xlValues;
xlArray.val.array.rows = 1;
xlArray.val.array.columns = 4;
return (LPXLOPER) &xlArray;
}

above function gives only first value of array i.e.10 in the cell from which
function call is made
is there is any way to fill the other cell? as i am giving no of row and
column in xloper it should fill 4 cell but that is not happening
 

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