I have a 8760 * 52 spreadsheet in a .CSV file. When I calculate values and add them to 12 additional columns, it takes approximately 5 minutes. Here I add the data 1 column at a time. The calculation itself takes very few seconds.

for (int j = 53; j < 65; ++j)

for (int i = 4; i <= workSheet.Cells.MaxRow; ++i)

double db = CalculationOnSomeCells();

workSheet.Cells[i, j].PutValue(db);

I have tried to speed up, by storing the result data in a double [,] array, and then adding data row-wise. And now it takes about 2 minutes.

int dataColumn = 53;

for (int j = 0; j < 12; ++j)

for (int i = 4; i <= workSheet.Cells.MaxRow; ++i)

{

double db = CalculationOnSomeCells();

db_array[i,j] = db;

}

for (int i = 4; i <= workSheet.Cells.MaxRow; ++i)

{

for (int j = 0; j < col; ++j)

{

workSheet.Cells[i, dataColumn + j].PutValue(db_array[i, j]);

}

}

I have tried to speed things up further, by using the Cells.ImportArray(double[,], row, column), and now it still takes approximately 2 minutes:

int dataColumn = 53;

for (int j = 0; j < 12; ++j)

```
for (int i = 4; i <= workSheet.Cells.MaxRow; ++i)<br> {<br>
double db = CalculationOnSomeCells();<br>
db_array[i,j] = db;<br> }<br>
```

workSheet.Cells.ImportArray(db_array, 4, dataColumn);

Is there anyway to speed up this process?

Yours

Lars Hammer