ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   cant pass array to excel from c++ using xloper structure (https://www.excelbanter.com/excel-worksheet-functions/247471-cant-pass-array-excel-c-using-xloper-structure.html)

malayhk

cant pass array to excel from c++ using xloper structure
 
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]=i*2;
xlValues[i].val.num = i+10;
xlValues[i].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




All times are GMT +1. The time now is 12:00 AM.

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