{"id":2349,"date":"2026-10-05T07:04:19","date_gmt":"2026-10-04T23:04:19","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2349"},"modified":"2026-03-29T09:44:08","modified_gmt":"2026-03-29T09:44:08","slug":"how-to-use-worksheetstandardheight-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-worksheetstandardheight-in-the-xlwings-api-way\/","title":{"rendered":"How to use Worksheet.StandardHeight in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The <code>StandardHeight<\/code> property in the Excel object model, accessible through the <code>Worksheet<\/code> object, refers to the standard (default) row height for the worksheet, measured in points. This value is typically set based on the default font size of the workbook&#8217;s normal style. In xlwings, you can retrieve this property to understand or utilize the baseline row height for formatting or layout calculations. It is a read-only property, meaning you cannot directly set it to change the default row height; instead, you would adjust row heights individually or modify the normal style&#8217;s font.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Syntax in xlwings:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>worksheet.api.StandardHeight<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>worksheet<\/code>: An xlwings <code>Sheet<\/code> object representing the Excel worksheet.<\/li>\n\n\n\n<li><code>.api<\/code>: This attribute provides access to the underlying Excel object model (via pywin32 on Windows or appscript on macOS).<\/li>\n\n\n\n<li><code>StandardHeight<\/code>: The property that returns a <code>float<\/code> value representing the standard height in points.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example Usage:<\/strong><br>Suppose you want to compare the current height of a specific row (e.g., row 5) with the standard row height to determine if it has been customized. You can use the <code>StandardHeight<\/code> property in conjunction with the <code>RowHeight<\/code> property.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\n# Connect to an existing workbook and worksheet\nwb = xw.Book(\"example.xlsx\")\nws = wb.sheets&#91;\"Sheet1\"]\n\n# Get the standard row height\nstandard_height = ws.api.StandardHeight\nprint(f\"Standard row height: {standard_height} points\")\n\n# Get the height of row 5\nrow5_height = ws.range(\"5:5\").row_height\nprint(f\"Row 5 height: {row5_height} points\")\n\n# Compare and provide feedback\nif row5_height == standard_height:\n    print(\"Row 5 uses the standard height.\")\nelse:\n    print(f\"Row 5 is customized. Difference: {row5_height - standard_height} points.\")\n\n# Close the workbook (optional, based on your workflow)\nwb.close()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The `StandardHeight` property in the Excel object model, accessible through the `Worksheet` object, &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-2349","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=2349"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2349\/revisions"}],"predecessor-version":[{"id":3581,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2349\/revisions\/3581"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2349"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}