{"record":{"id":"2f962f6ba7b03f1d","repo":"iOfficeAI/OfficeCLI","slug":"invalid-height-value-value-row-height-must","errorCode":null,"errorMessage":"Invalid 'height' value: '{value}'. Row height must be between 0 and 409.5 points.","messagePattern":"Invalid 'height' value: '(.+?)'\\. Row height must be between 0 and 409\\.5 points\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Handlers/Excel/ExcelHandler.Helpers.cs","lineNumber":157,"sourceCode":"        }\n        else\n        {\n            // Unit-qualified: convert via EMU then back to points.\n            try\n            {\n                var emu = OfficeCli.Core.EmuConverter.ParseEmu(trimmed);\n                pts = emu / EmuConverter.EmuPerPointF;\n            }\n            catch (Exception ex)\n            {\n                throw new ArgumentException($\"Invalid 'height' value: '{value}'. Expected a finite number or unit-qualified value (e.g. 15.75, 40pt, 40px, 1cm, 0.5in).\", ex);\n            }\n        }\n        // DEFERRED(xlsx/row-height-validation) RC2: Excel row height is bounded\n        // [0, 409.5] points. Values outside this range are rejected by Excel at\n        // open time (file silently repaired), so validate at Set time.\n        if (pts < 0 || pts > 409.5)\n            throw new ArgumentException($\"Invalid 'height' value: '{value}'. Row height must be between 0 and 409.5 points.\");\n        return pts;\n    }\n\n    // CONSISTENCY(rc-units): Column width is in \"maximum digit width\" char\n    // units (Calibri 11pt ≈ 7px per char). Accepts bare number (char units,\n    // legacy) or unit-qualified px/cm/in/pt — physical sizes converted via\n    // the 7-px-per-char approximation Excel uses internally.\n    internal static double ParseColWidthChars(string value)\n    {\n        if (string.IsNullOrWhiteSpace(value))\n            throw new ArgumentException(\"Column width cannot be empty.\");\n        var trimmed = value.Trim();\n        double chars;\n        if (double.TryParse(trimmed, System.Globalization.NumberStyles.Float,\n                System.Globalization.CultureInfo.InvariantCulture, out var bare)\n            && !char.IsLetter(trimmed[^1]))\n        {\n            if (double.IsNaN(bare) || double.IsInfinity(bare))","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Handlers/Excel/ExcelHandler.Helpers.cs#L139-L175","documentation":"Thrown by ParseRowHeightPoints after a successful parse when the resulting height in points falls outside Excel's hard limit of [0, 409.5]. Excel silently repairs files whose row height is out of range, so this validates at Set time to prevent producing a corrupt file.","triggerScenarios":"Passing height=500, height=-5, height=1000pt (≈ 1000 points), or any unit conversion whose point value exceeds 409.5 or drops below 0.","commonSituations":"Confusing points with pixels/char-units (typing height=200 thinking 200 pixels, which is 150pt and fine, but typing height=500 expecting pixels yields 500pt and is rejected); negative values from a sign error; very large unit conversions (5in = 360pt is fine, 7in = 504pt is rejected).","solutions":["Clamp the value into [0, 409.5] points (Excel's documented maximum row height is 409.5 points ≈ 546 pixels).","If you intended pixels, convert to points first: points = pixels * 72/96 = pixels * 0.75.","Re-check the unit: 409.5pt is about 409.5 points, 546px, 14.46cm, or 5.6in."],"exampleFix":"// before\nset /Sheet1/row[5] --prop height=500\n\n// after\nset /Sheet1/row[5] --prop height=409.5","handlingStrategy":"validation","validationCode":"const double RowHeightMax = 409.5;\ndouble pts = ExcelHandler.ParseRowHeightPoints(value);   // assume parse succeeded\nif (pts < 0 || pts > RowHeightMax)\n    throw new ArgumentException($\"Row height {pts}pt is out of [0, {RowHeightMax}].\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp row heights to [0, 409.5] points before setting.","Remember 409.5pt ≈ 546px ≈ 14.46cm if you are converting from other units."],"tags":["excel","validation","row-height","bounds","ooxml"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}