qax-os/excelize · error

ErrColumnNumber

ErrColumnNumber

Error message

the column number must be greater than or equal to %d and less than or equal to %d

What it means

Formatted error ErrColumnNumber returned during column insert/adjust operations when shifting a column by the offset would push it beyond MaxColumns (16384) or below MinColumns; at fault is the combination of the referenced cell's column and the requested offset.

Source

Thrown at errors.go:37

var (
	// ErrAddVBAProject defined the error message on add the VBA project in
	// the workbook.
	ErrAddVBAProject = errors.New("unsupported VBA project")
	// ErrAttrValBool defined the error message on marshal and unmarshal
	// boolean type XML attribute.
	ErrAttrValBool = errors.New("unexpected child of attrValBool")
	// ErrCellCharsLength defined the error message for receiving a cell
	// characters length that exceeds the limit.
	ErrCellCharsLength = fmt.Errorf("cell value must be 0-%d characters", TotalCellChars)
	// ErrCellStyles defined the error message on cell styles exceeds the limit.
	ErrCellStyles = fmt.Errorf("the cell styles exceeds the %d limit", MaxCellStyles)
	// ErrChartTitle defined the error message on both formula and rich text for
	// chart title.
	ErrChartTitle = errors.New("cannot set both 'Formula' and 'Paragraph' for chart title")
	// ErrColumnNumber defined the error message on receive an invalid column
	// number.
	ErrColumnNumber = fmt.Errorf("the column number must be greater than or equal to %d and less than or equal to %d", MinColumns, MaxColumns)
	// ErrColumnWidth defined the error message on receive an invalid column
	// width.
	ErrColumnWidth = fmt.Errorf("the width of the column must be less than or equal to %d characters", MaxColumnWidth)
	// ErrCoordinates defined the error message on invalid coordinates tuples
	// length.
	ErrCoordinates = errors.New("coordinates length must be 4")
	// ErrCustomNumFmt defined the error message on receive the empty custom
	// number format.
	ErrCustomNumFmt = errors.New("custom number format can not be empty")
	// ErrDataValidationFormulaLength defined the error message for receiving a
	// data validation formula length that exceeds the limit.
	ErrDataValidationFormulaLength = fmt.Errorf("data validation must be 0-%d characters", MaxFieldLength)
	// ErrDataValidationRange defined the error message on set decimal range
	// exceeds limit.
	ErrDataValidationRange = errors.New("data validation range exceeds limit")
	// ErrDefinedNameDuplicate defined the error message on the same name
	// already exists on the scope.
	ErrDefinedNameDuplicate = errors.New("the same name already exists on the scope")

View on GitHub (pinned to f2483381fb)

Solutions

  1. Reduce the number of columns inserted or the offset
  2. Operate on a sheet region that leaves room within the 16384-column limit
  3. Insert at a column far enough left that shifted cells stay in range
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at errors.go:37 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of qax-os/excelize@f2483381fb (2026-09-02). Data as JSON: /api/errors/69e5fec6049d6606. Report an issue: GitHub.