Skip to content

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

Description

@krystophny

Description

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions