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;