qax-os/excelize · error

invalid shared string index %d

Error message

invalid shared string index %d

What it means

Error from newInvalidSharedStringIndex, returned by shared-string readers (getValueFrom, getFromStringItem) when an index into the shared strings table is negative or beyond its length; at fault is the index read from the worksheet XML, usually a sign of file corruption.

Source

Thrown at errors.go:315

	return fmt.Errorf("invalid name %q, the name should be starts with a letter or underscore, can not include a space or character, and can not conflict with an existing name in the workbook", name)
}

// newInvalidOptionalValue defined the error message on receiving the invalid
// optional value.
func newInvalidOptionalValue(name, value string, values []string) error {
	return fmt.Errorf("invalid %s value %q, acceptable value should be one of %s", name, value, strings.Join(values, ", "))
}

// newInvalidRowNumberError defined the error message on receiving the invalid
// row number.
func newInvalidRowNumberError(row int) error {
	return fmt.Errorf("invalid row number %d", row)
}

// newInvalidSharedStringIndex defined the error message on receive an invalid
// shared string index.
func newInvalidSharedStringIndex(idx int) error {
	return fmt.Errorf("invalid shared string index %d", idx)
}

// newInvalidSlicerNameError defined the error message on receiving the invalid
// slicer name.
func newInvalidSlicerNameError(name string) error {
	return fmt.Errorf("invalid slicer name %q", name)
}

// newInvalidStyleID defined the error message on receiving the invalid style
// ID.
func newInvalidStyleID(styleID int) error {
	return fmt.Errorf("invalid style ID %d", styleID)
}

// newNoExistSlicerError defined the error message on receiving the non existing
// slicer name.
func newNoExistSlicerError(name string) error {
	return fmt.Errorf("slicer %s does not exist", name)

View on GitHub (pinned to f2483381fb)

Solutions

  1. Treat the workbook as corrupted and fall back to re-creating or repairing it
  2. Inspect the sst table count versus the cell's si attribute
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at errors.go:315 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/ff16390631d8f591. Report an issue: GitHub.