2

I used Excel.Range.Value but it writes the same value to all the columns' cells.

object[] weights = new object[10000];

Excel.Range startCell = (Excel.Range)worksheet.Cells[2, cols+1];
Excel.Range endCell = (Excel.Range)worksheet.Cells[rows, cols+1];
Excel.Range writeRange = worksheet.get_Range(startCell,endCell);
writeRange.Value = weights;
  • I used the Excel.Range and it worked , but all the columns'cells have the same value. Note: array weights contains different values – user2188099 May 22 '13 at 11:13
  • You mean all your cells contain `weights[0]` – Shark May 22 '13 at 11:14
  • So it didn't really "work" and you have the same problem as the guy that asked the other question. Go check it out ;) – Shark May 22 '13 at 11:18

1 Answers1

2

The Range.Value property takes a 2D Object for non-scalar values.

Bathsheba
  • 231,907
  • 34
  • 361
  • 483