Initially i thought there was a problem with my query, as it uses a DLL to talk to ActivePivot, get a 2D array back, and the data is definitely there. In fact if I comment out the "Resize" call it gets passed back to Excel, but i need to resize mt results.
It was working fine on my other PC, with Excel 2016.
is there a way to resize the Excel array in 2016 without the older use of the "Resize" function?
public static object Resize(object[,] array)
{
ExcelReference caller = XlCall.Excel(XlCall.xlfCaller) as ExcelReference;
if (caller == null)
return array;
int rows = array.GetLength(0);
int columns = array.GetLength(1);
if ((caller.RowLast - caller.RowFirst + 1 != rows) ||
(caller.ColumnLast - caller.ColumnFirst + 1 != columns))
{
// Size problem: enqueue job, call async update and return #N/A
// TODO: Add guard for ever-changing result?
EnqueueResize(caller, rows, columns);
AsyncRunMacro("DoResizing");
return ExcelError.ExcelErrorNA;
}
// Size is already OK - just return result
return array;
//object[,] retArray = new object[columns, rows];
//for(int i=0;i<array.Length;i++)
//{
// retArray[i, 0] = array[0, i];
//}
//return retArray;
}