This project has moved and is read-only. For the latest updates, please go here.

Calculating formulas

Oct 19, 2016 at 4:37 PM
I am creating a spreadsheet by loading a lot of data from text file. One of the sheets contains around 500 columns and hundred or so rows filled with a (simple) formula.

The problem I'm facing is that populating this sheet programmatically takes about a minute, which is too long. I believe it's because everything is recalculated after each insertion?

How to simply fill the cell with formula and only let Excel recalculate the formula when the sheet is opened in Excel? It takes several seconds.
Dec 19, 2016 at 8:37 PM
Edited Dec 19, 2016 at 8:41 PM
use something like :
worksheet2.Cells[row, col].Formula = "SUMIFS(DATA!FN:FN,DATA!U:U,\"" + item.PRODUCT_NAME + "\")";
find more example at external link