{"id":16,"date":"2026-01-25T17:37:42","date_gmt":"2026-01-25T09:37:42","guid":{"rendered":"https:\/\/openpyxl.com\/blog\/?p=16"},"modified":"2026-01-16T06:06:20","modified_gmt":"2026-01-16T06:06:20","slug":"other-properties-and-methods-using-openpyxl","status":"publish","type":"post","link":"https:\/\/openpyxl.com\/blog\/other-properties-and-methods-using-openpyxl.html","title":{"rendered":"Other Properties and Methods Using OpenPyXL"},"content":{"rendered":"<h2>Method<\/h2>\n<p>&gt;&gt;&gt; ws.title\u00a0\u00a0 # The name of the worksheet<\/p>\n<p>&#8216;Sheet&#8217;<\/p>\n<p>&gt;&gt;&gt; ws.sheet_state\u00a0\u00a0 # The visibility state<\/p>\n<p>&#8216;visible&#8217;<\/p>\n<p>&gt;&gt;&gt; ws.dimensions\u00a0 # The size of the area containing data in the table<\/p>\n<p>&#8216;A2:G10&#8217;<\/p>\n<p>&gt;&gt;&gt; ws.sheet_properties\u00a0 # Properties related to the worksheet, including tabColor, tagname, etc.<\/p>\n<p>&gt;&gt;&gt; ws.sheet_properties.tabColor=&#8217;FF0000&#8242;\u00a0\u00a0 # Set the background color of the tab label<\/p>\n<p>&gt;&gt;&gt; ws.active_cell\u00a0\u00a0\u00a0\u00a0 # The active cell<\/p>\n<p>&#8216;C9&#8217;<\/p>\n<p>&gt;&gt;&gt; ws.selected_cell\u00a0\u00a0\u00a0 # The selected cell<\/p>\n<p>&#8216;C9&#8217;<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Other Worksheet Properties and Methods\n\n#Import load_workbook function\nfrom openpyxl import Workbook\n\n#Create a new workbook\nwb=Workbook()\n#Get the active worksheet\nws=wb.active\n\n#Worksheet title\nprint(ws.title)\n#Visibility status\nprint(ws.sheet_state)\n#Size of the portion of the table that contains data\nprint(ws.dimensions)\n#Worksheet properties including tabColor, tagname etc.\nprint(ws.sheet_properties)\n#Set the background color of the tab label\nprint(ws.sheet_properties.tabColor='FF0000')\n#Active cell\nprint(ws.active_cell)\n#Selected cells\nprint(ws.selected_cell)\n\nwb.save('test.xlsx')\nwb.close()<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>OpenPyXL<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16","post","type-post","status-publish","format-standard","hentry","category-openpyxl-worksheet"],"_links":{"self":[{"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/posts\/16","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/comments?post=16"}],"version-history":[{"count":2,"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions"}],"predecessor-version":[{"id":225,"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/posts\/16\/revisions\/225"}],"wp:attachment":[{"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/media?parent=16"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/categories?post=16"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/openpyxl.com\/blog\/wp-json\/wp\/v2\/tags?post=16"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}