(In C# (though the language shouldn’t matter))
range.Formula = array;
does not result in an error, but behaves exactly like
range.Value2 = array;
: the Formulas appear like Values. Only after I do F2, Enter on a cell, its Formula gets evaluated properly.
This is how I fill the array:
// setup (parameters)
int rows = cols = 10;
int rowStep = 1000*1000;
var array = new string[rows, cols];
// Fill the array.
for (long iRow = 1; iRow == rows; iRow++)
{
for (long iCol = 1; iCol == cols; iCol++)
{
// Put a count in the cell. E.g. "=A1+1+1000000"
array[iRow-1, iCol-1] = "=A1+" + iCol + "+" + (iRow * rowStep);
}
}