{"id":2314,"date":"2026-09-17T15:39:14","date_gmt":"2026-09-17T07:39:14","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2314"},"modified":"2026-03-28T12:52:50","modified_gmt":"2026-03-28T12:52:50","slug":"how-to-use-worksheetcreator-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-worksheetcreator-in-the-xlwings-api-way\/","title":{"rendered":"How to use Worksheet.Creator in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The <strong>Creator<\/strong> property of a <strong>Worksheet<\/strong> object in the Excel object model is a read-only property that returns a 32-bit integer representing the application in which the worksheet was originally created. This is particularly useful for compatibility and identification purposes when working with files that may have been created in different versions of Excel or other spreadsheet applications. In xlwings, you can access this property to determine the creator application of a specific worksheet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Functionality:<\/strong><br>The primary function of the Creator property is to identify the application that created the worksheet. This can be important in scenarios where macros or specific features depend on the original application version. For example, it helps in ensuring backward compatibility or in logging the origin of spreadsheet files during automated processing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Syntax in xlwings:<\/strong><br>In xlwings, the Creator property is accessed through the <code>api<\/code> property of a worksheet object, which provides direct access to the underlying Excel object model. The syntax is straightforward:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>worksheet.api.Creator<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This returns an integer value (a long integer) that corresponds to the creator application. Common values include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>1480803660<\/code> for Microsoft Excel (this is a typical value for Excel, but it can vary based on version and system).<\/li>\n\n\n\n<li>Other values may represent different applications like older versions or third-party tools.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Parameters:<\/strong><br>The Creator property does not accept any parameters; it is a simple property getter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example Usage:<\/strong><br>Here is a practical example of how to use the Creator property in xlwings to check the creator of a worksheet in an Excel workbook:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\n# Open an existing workbook\nwb = xw.Book('example.xlsx')\n\n# Access a specific worksheet by name\nws = wb.sheets&#91;'Sheet1']\n\n# Retrieve the Creator property\ncreator_code = ws.api.Creator\n\n# Display the result\nprint(f\"The creator code of the worksheet is: {creator_code}\")\n\n# Optionally, interpret the code (this is a simplified example)\nif creator_code == 1480803660:\n    print(\"This worksheet was created in Microsoft Excel.\")\nelse:\n    print(\"This worksheet may have been created in a different application.\")\n\n# Close the workbook if needed\nwb.close()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The **Creator** property of a **Worksheet** object in the Excel object model is a read-only property&#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-2314","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2314","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=2314"}],"version-history":[{"count":1,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2314\/revisions"}],"predecessor-version":[{"id":3528,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2314\/revisions\/3528"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}