I have the following C# List:
List<Response> listAllData = new List<Response>();
listAllData.Add(new Response() {
strId = propResponse.strId,
strName = propResponse.strName
});
And then I am converting it to an array as such:
object[] array2 = listAllData.ToArray();
But when I'm trying to write data to a range using:
rngValues.Value = array2;
I'm getting an error
Exception from HRESULT: 0x800A03EC
I am (reasonably) certain this is b/c the resulting array2 is not actually a 2D multidimensional array, but instead an array-of-arrays.
So my question is... How do I get my listAllData into a 2D array?
It is not a "jagged array" meaning there are always 2 elements in each entry.
listAllData.ToArray()into object array. that would not even compile. (note you cant assignResponse[]toobject[]but anobject. or you have to cast element by element.)