#2308·excelize

Add RecalcOptions{Sheet, Ref} to scope File.Recalc

Author: krystophnyCreated Apr 23, 2026Updated Apr 27, 2026
Labelsenhancement

Description

Follow-up to the whole-workbook File.Recalc entry point: allow callers to narrow the sweep via a RecalcOptions value.

go
type RecalcOptions struct {
    Sheet string // limit recalc to a single worksheet
    Ref   string // limit recalc to an A1-style range (requires Sheet)
}

func (f *File) Recalc(opts ...RecalcOptions) error

The zero value (no options passed) preserves the existing whole-workbook behaviour. Ref without Sheet returns a wrapped ErrParameterRequired. An unknown sheet or malformed Ref returns a clear diagnostic.

Additional context

Workbooks can be large. When a caller knows exactly which sheet, or which row/column band, changed, walking every formula on every sheet is wasted work. Scoping is purely additive to the API introduced by #2303 and does not change the default behaviour.

Validations

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