{"id":2033,"date":"2026-04-30T07:12:51","date_gmt":"2026-04-29T23:12:51","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2033"},"modified":"2026-03-28T05:27:31","modified_gmt":"2026-03-28T05:27:31","slug":"how-to-use-applicationarbitraryxmlsupportavailable-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-applicationarbitraryxmlsupportavailable-in-the-xlwings-api-way\/","title":{"rendered":"How to use Application.ArbitraryXMLSupportAvailable in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>ArbitraryXMLSupportAvailable<\/strong> is a read-only property of the <strong>Application<\/strong> object in the Excel object model. This property returns a <strong>Boolean<\/strong> value that indicates whether Excel supports the use of arbitrary XML schemas. Specifically, it checks if the installed version of Excel has the capability to work with custom-defined XML maps and schemas beyond the built-in XML features. This is particularly relevant for developers who need to import, export, or manipulate data using non-standard XML formats directly within Excel. When this property returns <strong>True<\/strong>, it means the Excel instance can handle arbitrary XML mappings; if <strong>False<\/strong>, such functionality is not available, typically in older versions of Excel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In xlwings, you access this property through the <code>Application<\/code> object, which is the top-level object representing the Excel application itself. The xlwings API provides a Pythonic way to interact with Excel&#8217;s COM interface, allowing you to check this property directly from your Python script.<\/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>app.ArbitraryXMLSupportAvailable<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>app<\/strong>: This is an instance of the xlwings <code>App<\/code> class, which corresponds to the Excel <strong>Application<\/strong> object. You typically obtain it by creating a new instance (<code>app = xw.App()<\/code>) or by connecting to an existing one (<code>app = xw.apps.active<\/code>).<\/li>\n\n\n\n<li>The property takes no parameters and returns a Boolean (<code>True<\/code> or <code>False<\/code>).<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><br>Below is a practical example demonstrating how to use the <code>ArbitraryXMLSupportAvailable<\/code> property in xlwings. This script checks if the current Excel application supports arbitrary XML schemas and prints a message accordingly. It also handles the Excel application properly by quitting after the operation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\n# Start or connect to an Excel application\napp = xw.App(visible=False) # Set visible=True to see the Excel window\n\ntry:\n    # Check if arbitrary XML support is available\n    xml_support = app.api.ArbitraryXMLSupportAvailable\n\n    if xml_support:\n        print(\"This Excel instance supports arbitrary XML schemas.\")\n    else:\n        print(\"Arbitrary XML schema support is NOT available in this Excel version.\")\n\n    # Optional: Display the Boolean value\n    print(f\"Value of ArbitraryXMLSupportAvailable: {xml_support}\")\n\nexcept AttributeError as e:\n    print(f\"Error accessing property: {e}. This may indicate an older Excel version or API issue.\")\n\nfinally:\n    # Close the Excel application\n    app.quit()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The script uses <code>app.api.ArbitraryXMLSupportAvailable<\/code> to access the property. In xlwings, the <code>.api<\/code> attribute provides direct access to the underlying Excel COM object model, ensuring compatibility with properties like this one.<\/li>\n\n\n\n<li>The <code>try-except<\/code> block catches <code>AttributeError<\/code>, which might occur if the property is not available in the Excel version being used (though this property is present in most modern versions).<\/li>\n\n\n\n<li>The <code>finally<\/code> block ensures that the Excel application is closed properly using <code>app.quit()<\/code>, which is good practice to avoid lingering processes.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>**ArbitraryXMLSupportAvailable** is a read-only property of the **Application** object in the Excel &#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-2033","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2033","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=2033"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2033\/revisions"}],"predecessor-version":[{"id":3107,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2033\/revisions\/3107"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}