Free Support Forum -

Performance of cells.cell.Formula assignment

Profiling my spreadsheet creation, I find that 78% of the time is spent on one line of code:

Public Sub SetCellFormula(ByVal theCell As Aspose.Cells.Cell, ByVal rawExpression As String)

theCell.Formula = rawExpression

End Sub

Sure, there are a lot of formulas, but this still seems a bit of a surprize. Am I using the best method to set a formula? Just looking for a reality check on this...

The workbook structure is 3 major sheets: rawdata, To and From. The rawdata sheet tends to be 120 columns wide by ~200 (variable) rows. The To and From sheets have the same layout, with many columns hidden and forumlas like "=RawItems!$J10".

I've seen tales of much larger and more complex workbooks in these forums..

Set a formula to a cell is much more complex than putting a value to a cell. But we will try to see if we can do some optimization.