{"id":2252,"date":"2026-08-17T15:00:02","date_gmt":"2026-08-17T07:00:02","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2252"},"modified":"2026-03-28T11:56:09","modified_gmt":"2026-03-28T11:56:09","slug":"how-to-use-workbookcreator-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-workbookcreator-in-the-xlwings-api-way\/","title":{"rendered":"How to use Workbook.Creator in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Creator property of the Workbook object in Excel&#8217;s object model is a read-only attribute that returns a 32-bit integer representing the application that originally created the workbook. This value is a unique identifier, often used to distinguish between workbooks created by different versions of Excel or other applications that can generate Excel files, such as older Mac versions or third-party software. In xlwings, this property can be accessed directly from a Workbook instance, providing compatibility information that can be useful for debugging, version control, or conditional logic in automation scripts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Syntax in xlwings:<\/strong><br><code>workbook_instance.creator<\/code><br>This property does not accept any parameters. It returns an integer value. The meaning of specific integer values is not publicly documented by Microsoft in a comprehensive list, but common values include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>1480803660<\/code> (hex: <code>0x5843454C<\/code>): Typically indicates the workbook was created by a version of Excel for Windows.<\/li>\n\n\n\n<li><code>1480803660<\/code> (hex: <code>0x5843434D<\/code>): Often associated with Excel for Mac.<br>Other values may correspond to different creation sources.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example Usage:<\/strong><br>Suppose you have an Excel workbook and you want to check its origin before performing specific operations. You can use xlwings to retrieve the Creator value and act accordingly. Here\u2019s a practical code example:<\/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 the Creator property\ncreator_value = wb.creator\n\n# Display the result\nprint(f\"The workbook's creator code is: {creator_value}\")\n\n# Conditional logic based on the creator\nif creator_value == 1480803660: # Common code for Excel Windows\n    print(\"This workbook was likely created by Excel for Windows.\")\nelif creator_value == 1480803660: # Note: This is an example; actual Mac codes may vary\n    print(\"This workbook may have been created by Excel for Mac.\")\nelse:\n    print(\"The creator application is unknown or from a different source.\")\n\n# You can also use it in automation, e.g., to log workbook origins\nwith open('workbook_log.txt', 'a') as log_file:\nlog_file.write(f\"Workbook: {wb.name}, Creator Code: {creator_value}\\n\")\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 the Workbook object in Excel&apos;s object model is a read-only attribute that re&#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-2252","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2252","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=2252"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2252\/revisions"}],"predecessor-version":[{"id":3440,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2252\/revisions\/3440"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2252"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}