{"id":2239,"date":"2026-08-11T07:10:17","date_gmt":"2026-08-10T23:10:17","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2239"},"modified":"2026-03-28T11:45:42","modified_gmt":"2026-03-28T11:45:42","slug":"how-to-use-workbookscreator-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-workbookscreator-in-the-xlwings-api-way\/","title":{"rendered":"How to use Workbooks.Creator in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The <code>Creator<\/code> property of the <code>Workbooks<\/code> object in Excel&#8217;s object model is a read-only property that returns a Long value representing the creator code for the application that created the file. This is particularly useful for identifying the original application when dealing with files that may have been created in different versions of Excel or other spreadsheet programs. In xlwings, this property can be accessed through the <code>api<\/code> property, which provides direct access to the underlying Excel object model.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Functionality:<\/strong><br>The <code>Creator<\/code> property helps in determining the application that originally created the workbook. It returns a four-character code (as a Long integer) that corresponds to the creator. For example, Microsoft Excel typically uses the code &#8220;XCEL&#8221;. This can be useful in scenarios where you need to verify file origins or handle compatibility issues.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Syntax:<\/strong><br>In xlwings, the syntax to access the <code>Creator<\/code> property is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>workbook.api.Creator<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, <code>workbook<\/code> refers to an xlwings <code>Book<\/code> object. The property does not take any parameters and returns a Long value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:<\/strong><br>Below is a practical example of how to use the <code>Creator<\/code> property in xlwings to check the creator of an open workbook. This code opens a workbook, retrieves the creator code, and prints it along with a descriptive message.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\n# Open an existing workbook or connect to an open one\nwb = xw.Book('example.xlsx') # Replace with your file path\n\n# Access the Creator property via the api\ncreator_code = wb.api.Creator\n\n# Convert the Long code to a readable string (optional)\n# Typically, you might map known codes to application names\nif creator_code == 1480803660: # This is 'XCEL' in decimal for Excel\n    creator_name = \"Microsoft Excel\"\nelse:\n    creator_name = \"Unknown Application\"\n\n# Output the result\nprint(f\"The workbook creator code is: {creator_code}\")\nprint(f\"This corresponds to: {creator_name}\")\n\n# Close the workbook if needed (optional)\nwb.close()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The `Creator` property of the `Workbooks` object in Excel&apos;s object model is a read-only property tha&#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-2239","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2239","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=2239"}],"version-history":[{"count":1,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2239\/revisions"}],"predecessor-version":[{"id":3421,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2239\/revisions\/3421"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}