Skip to content

Add (*File).RecalcCell to persist a single formula cell's cached value #2307

@krystophny

Description

@krystophny

Description

Add a single-cell recalc entry point:

func (f *File) RecalcCell(sheet, cell string) error

It should evaluate the formula in the given cell with the existing recursive calc engine and write the typed result into the cell's cached <v>/<t> without touching <f>, the shared-formula master, ref span, or si index. Returns a sentinel error when the cell holds no formula.

Additional context

CalcCellValue today returns a formatted string but never writes it back. Every SetCell* writer strips <f> via removeFormula, so a caller cannot refresh the cached value while preserving the formula. Readers that honour <v> without recomputing (LibreOffice headless, Numbers, streaming parsers) therefore see stale results after any excelize round trip.

This issue is the granular version of the single-cell half of #2303. A follow-up issue will cover whole-workbook recalc built on top of this primitive.

Validations

  • Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions