{"id":2215,"date":"2026-07-30T07:05:29","date_gmt":"2026-07-29T23:05:29","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2215"},"modified":"2026-03-28T11:16:31","modified_gmt":"2026-03-28T11:16:31","slug":"how-to-use-applicationusesystemseparators-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-applicationusesystemseparators-in-the-xlwings-api-way\/","title":{"rendered":"How to use Application.UseSystemSeparators in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Application.UseSystemSeparators property in Excel is a Boolean value that controls whether Excel uses the system&#8217;s decimal and thousands separators for number formatting, or the separators specified in the Windows regional settings for the Excel application itself. When set to <code>True<\/code> (the default), Excel will use the separators defined by the operating system&#8217;s regional settings (e.g., a period for decimal and a comma for thousands in the US locale). When set to <code>False<\/code>, Excel will use the alternative separators, which are typically a comma for decimal and a period for thousands, as might be used in some European locales. This property is crucial for ensuring data is displayed and interpreted correctly in international environments, especially when workbooks are shared across different regional systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the xlwings API, this property is accessed through the <code>Application<\/code> object. The syntax for getting or setting the property is straightforward:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\napp = xw.apps.active # or xw.App() for a new instance\n\n# Get the current value\ncurrent_setting = app.api.UseSystemSeparators\n\n# Set the value\napp.api.UseSystemSeparators = False # Use alternative separators<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, <code>app.api<\/code> provides direct access to the underlying Excel Application object from the COM interface. The <code>UseSystemSeparators<\/code> property is a read\/write Boolean. No parameters are required for getting or setting it. To determine the system&#8217;s current separators, you can check the <code>Application.DecimalSeparator<\/code> and <code>Application.ThousandsSeparator<\/code> properties, which are influenced by this setting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example use cases include preparing a workbook for users in a locale with different formatting norms or ensuring consistent number parsing in automated scripts. Below is a practical xlwings code example that demonstrates toggling this property and observing the effect on cell formatting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\n# Connect to the active Excel instance\napp = xw.apps.active\n\n# Display initial state\nprint(f\"Initial UseSystemSeparators: {app.api.UseSystemSeparators}\")\nprint(f\"Decimal Separator: {app.api.DecimalSeparator}\")\nprint(f\"Thousands Separator: {app.api.ThousandsSeparator}\")\n\n# Change to alternative separators\napp.api.UseSystemSeparators = False\nprint(f\"\\nAfter setting to False:\")\nprint(f\"Decimal Separator: {app.api.DecimalSeparator}\")\nprint(f\"Thousands Separator: {app.api.ThousandsSeparator}\")\n\n# Write a sample number to a cell to see formatting\nwb = app.books.active\nws = wb.sheets&#91;0]\nws.range('A1').value = 12345.67\nws.range('A1').number_format = '#,##0.00'\n\n# The display in Excel will reflect the current separators.\n# For example, with UseSystemSeparators=False, it might show as \"12.345,67\" depending on system settings.\n\n# Revert to system separators\napp.api.UseSystemSeparators = True\nprint(f\"\\nReverted to True:\")\nprint(f\"Decimal Separator: {app.api.DecimalSeparator}\")\nprint(f\"Thousands Separator: {app.api.ThousandsSeparator}\")\n\n# Save and close\nwb.save()\napp.quit()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Application.UseSystemSeparators property in Excel is a Boolean value that controls whether 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-2215","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2215","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=2215"}],"version-history":[{"count":1,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2215\/revisions"}],"predecessor-version":[{"id":3387,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2215\/revisions\/3387"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2215"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}