qax-os/excelize · error

invalid link type

Error message

invalid link type %q

What it means

Error from newInvalidLinkTypeError, returned by SetCellHyperLink/GetHyperLinkCells when the LinkType is not one of the supported types ("External" or "Location"); at fault is the link type string passed to the hyperlink API.

Solutions

  1. Use LinkTypeExternal or LinkTypeLocation
  2. Map custom type names to the supported constants before calling
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

Thrown at errors.go:291

	return fmt.Errorf("invalid cell name %q", cell)
}

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

// newInvalidExcelDateError defined the error message on receiving the data
// with negative values.
func newInvalidExcelDateError(dateValue float64) error {
	return fmt.Errorf("invalid date value %f, negative values are not supported", dateValue)
}

// newInvalidLinkTypeError defined the error message on receiving the invalid
// hyper link type.
func newInvalidLinkTypeError(linkType string) error {
	return fmt.Errorf("invalid link type %q", linkType)
}

// newInvalidNameError defined the error message on receiving the invalid
// defined name or table name.
func newInvalidNameError(name string) error {
	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)

View on GitHub (pinned to f2483381fb)