{"record":{"id":"56d1e7e04250e0c4","repo":"qax-os/excelize","slug":"cannot-convert-cell-q-to-coordinates-v","errorCode":null,"errorMessage":"cannot convert cell %q to coordinates: %v","messagePattern":"cannot convert cell %q to coordinates: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"errors.go","lineNumber":231,"sourceCode":"type ErrSheetNotExist struct {\n\tSheetName string\n}\n\n// Error returns the error message on receiving the non existing sheet name.\nfunc (err ErrSheetNotExist) Error() string {\n\treturn fmt.Sprintf(\"sheet %s does not exist\", err.SheetName)\n}\n\n// newAddCommentError defined the error message on the comment already exist in\n// the cell.\nfunc newAddCommentError(cell string) error {\n\treturn fmt.Errorf(\"comment already exist on cell %s\", cell)\n}\n\n// newCellNameToCoordinatesError defined the error message on converts\n// alphanumeric cell name to coordinates.\nfunc newCellNameToCoordinatesError(cell string, err error) error {\n\treturn fmt.Errorf(\"cannot convert cell %q to coordinates: %v\", cell, err)\n}\n\n// newChartTitleError defined the error message on receiving the invalid chart\n// title parameters.\nfunc newChartTitleError(name string) error {\n\treturn fmt.Errorf(\"chart title field %s value must be an integer from 0 to 100\", name)\n}\n\n// newCoordinatesToCellNameError defined the error message on converts [X, Y]\n// coordinates to alpha-numeric cell name.\nfunc newCoordinatesToCellNameError(col, row int) error {\n\treturn fmt.Errorf(\"invalid cell reference [%d, %d]\", col, row)\n}\n\n// newFieldLengthError defined the error message on receiving the field length\n// overflow.\nfunc newFieldLengthError(name string) error {\n\treturn fmt.Errorf(\"field %s must be less than or equal to 255 characters\", name)","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/qax-os/excelize/blob/f2483381fbfbe432a6baa98d48a1c277183f3285/errors.go#L213-L249","documentation":"newCellNameToCoordinatesError wraps a lower-level failure that occurred while converting an alphanumeric cell reference (like \"A1\") into [col, row] coordinates. It is used across adjustment/remerge code paths (merge cells, auto filter, calc chain, formula adjust) so callers get context about which cell could not be parsed and the underlying reason.","triggerScenarios":"Passing a malformed cell reference (e.g. \"\", \"1A\", \"AAA0000\" beyond limits, or a name that fails coordinate conversion) into APIs that touch merged cells, filters, formulas, or the calc chain during sheet adjust operations.","commonSituations":"Building cell references by string concatenation and producing empty or off-by-one values; user-supplied ranges with typos; column letters exceeding Excel's range (e.g. \"XFE1\").","solutions":["Validate cell references before use, e.g. with excelize.CoordinatesToCellName/CellNameToCoordinates round-trip in a defer-and-check","Fix the source of the malformed reference (empty string, swapped row/column)","Inspect the wrapped %v cause in the message to see the exact parse failure"],"exampleFix":"// before\nf.SetCellFormula(\"Sheet1\", userRef, \"=SUM(A1:A2)\") // userRef may be invalid\n// after\nif _, _, err := excelize.CellNameToCoordinates(userRef); err != nil {\n\treturn fmt.Errorf(\"invalid cell ref %q\", userRef)\n}\nf.SetCellFormula(\"Sheet1\", userRef, \"=SUM(A1:A2)\")","handlingStrategy":"validation","validationCode":"if _, _, err := excelize.CellNameToCoordinates(ref); err != nil { return fmt.Errorf(\"bad cell ref %q\", ref) }","typeGuard":"func validCellRef(s string) bool { _, _, err := excelize.CellNameToCoordinates(s); return err == nil }","tryCatchPattern":null,"preventionTips":["Validate all cell reference strings before passing them to excelize APIs","Never build references by naive string concatenation without a validity check","Read the wrapped cause in the error to pinpoint the malformed input"],"tags":["excelize","cell-reference","parsing","coordinates"],"backgroundTag":"invalid-cell-reference","analyzedSha":"f2483381fbfbe432a6baa98d48a1c277183f3285","analyzedAt":"2026-09-02T01:26:19.299Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}