title: Write Array to Excel Range
body: <p>I'm currently trying to write data from an array of objects to a range in Excel using the following code, where <code>objData</code> is just an array of strings:</p>
  
  <pre><code>private object m = System.Type.Missing;
  object[] objData = getDataIWantToWrite();
  
  Range rn_Temp;
  rn_Temp = (Range)XlApp.get_Range(RangeName, m);
  rn_Temp = rn_Temp.get_Resize(objData.GetUpperBound(), 1);
  rn_Temp.value2 = objData;
  </code></pre>
  
  <p>This very nearly works, the problem being that the range gets filled but every cell gets the value of the first item in the <code>objData</code>.</p>
  
  <p>The inverse works, i.e.</p>
  
  <pre><code>private object m = System.Type.Missing;
  object[] objData = new object[x,y]
  
  Range rn_Temp;
  rn_Temp = (Range)XlApp.get_Range(RangeName, m);
  rn_Temp = rn_Temp.get_Resize(objData.GetUpperBound(), 1);
  objData = (object[])rn_Temp.value2;
  </code></pre>
  
  <p>would return an array containing all of the values from the worksheet, so I'm not sure why reading and assignment work differently.</p>
  
  <p>Has anyone ever done this successfully? I'm currently writing the array cell by cell, but it needs to cope with lots (>50,000) of rows and this is therefore very time consuming.</p>