Free Support Forum -

cell.SetCellValue vs cell.Value

Maybe this is already public knowledge, but I was populating about 1,500 cells by setting the Value property and it was taking over 100 seconds.

I decided to try the SetCellValue() method and it cut it down to 5 seconds.

So, it seems SetCellValue is MUCH faster than Value.


This is the description of GridCell.Value attribute:

“Gets or sets a cell value. If value is formula, the set method of this property will call GridDesktop.RunAllFormulas method automatic. So, if there are many formulas, using SetCellValue method instead of this property. SetCellValue method will enhance performance.”

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

This is the description of GridCell.SetCellValue() method:

“If the value is a formula, this method set cell's value as FormulaType, but not calculate formula. To calculate formula, need call GridDesktop.RunAllFormulas manually. If multi values to be set, call this method multi times, finally, call GridDesktop.RunAllFormulas method manually to calculate formulas. This is more effective.”

Please refer to the Aspose.Grid.Desktoop Api doc from:

Thank you