Hello Tmaxial,
As you mentioned in your post, you would use Method 3 in the WriteDataToExcel callback in the exceldemo2000 example program. For each string in your array, you would convert it to a BSTR with the CA_CStringToBSTR function. Then, you would save all your BSTRs in one VARIANT array using the CA_VariantSetBSTR function. Then, you would convert the VARIANT array into a SAFEARRAY, then store the resulting SAFEARRAY as a VARIANT using the CA_Array2DToSafeArray and CA_VariantSetSafeArray functions. From there, you can assign values to multiple excel cells at one time using the Excel_SetProperty function.
So a section of the modified write callback would look something like:
#define ROWS 2
#define COLUMNS 2
char * excelString[] = {"String 1", "String 2", "String 3", "String 4"};
BSTR bstring;
...
for (i=0;i lessthan ROWS;i++)
{
for (j=0;j lessthan COLUMNS;j++)
{
CA_CStringToBSTR (excelString[i*COLUMNS+j], &bstring);
error = CA_VariantSetBSTR (&vArray[i*COLUMNS+j], bstring);
}
}
...
Where "lessthan" should be replaced with the left carat sign.
Hope that helps.