setRecalculateFormulasOnNextOpen - cfsimplicity/spreadsheet-cfml GitHub Wiki

Set a flag to force all formulas to be recalculated the next time the spreadsheet file is opened (in Excel etc).

setRecalculateFormulasOnNextOpen( workbook[, value ] )

Required arguments

  • workbook spreadsheet object

Optional arguments

  • value boolean default=true
  • sheetName string: if specified, only formulas in that sheet will be flagged for recalculation

Chainable? Yes.

Note

Recalculating formulas can take time so deferring the operation aviods additional processing. However, if you need to recalculate formulas immediately, use recalculateAllFormulas.

Related

getRecalculateFormulasOnNextOpen, recalculateAllFormulas, setReturnCachedFormulaValues

Example

spreadsheet = New spreadsheet();
workbook = spreadsheet.new();
spreadsheet.setCellValue( workbook , "72", 3, 4 ); /* set value of cell */
spreadsheet.setRecalculateFormulasOnNextOpen( workbook , true );

Notes

Spreadsheets generally cache the results of formulas for performance reasons. If you use the library to modify cell values referenced by formulas, the results may therefore not change.

Setting this flag after making changes will ensure that any formulas are recalculated by Excel (or equivalent) the next time the spreadsheet is opened.