{"id":2207,"date":"2026-07-26T07:55:07","date_gmt":"2026-07-25T23:55:07","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2207"},"modified":"2026-03-28T10:44:19","modified_gmt":"2026-03-28T10:44:19","slug":"how-to-use-applicationtransitionnavigkeys-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-applicationtransitionnavigkeys-in-the-xlwings-api-way\/","title":{"rendered":"How to use Application.TransitionNavigKeys in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Application.TransitionNavigKeys property in Excel is a legacy feature that determines whether certain navigation keys, originally from Lotus 1-2-3, are enabled within Excel. Specifically, when this property is set to <code>True<\/code>, pressing the left arrow key or the right arrow key will move the active cell left or right within the worksheet, as is standard in Excel. However, when set to <code>False<\/code>, these keys instead move the active cell to the next non-blank cell in the direction pressed, mimicking the behavior found in older Lotus 1-2-3 spreadsheets. This property is primarily maintained for backward compatibility with legacy spreadsheet applications and is rarely used in modern Excel workflows. In xlwings, this property can be accessed and modified to control this specific keyboard navigation behavior programmatically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Functionality:<\/strong><br>The main purpose of the <code>TransitionNavigKeys<\/code> property is to toggle between standard Excel cell navigation and the Lotus 1-2-3 style of navigation using the arrow keys. This can affect user interaction within a workbook, especially if the workbook or macro is designed for users accustomed to the older Lotus behavior.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Syntax in xlwings:<\/strong><br>The property is accessed through the <code>xlwings.App<\/code> object, which corresponds to the Excel Application object. The syntax is straightforward as it is a simple Boolean property.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># To get the current value\ncurrent_setting = xw.apps.active.api.TransitionNavigKeys\n\n# To set a new value\nxw.apps.active.api.TransitionNavigKeys = True # or False<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, <code>xw.apps.active.api<\/code> provides the raw COM interface to the Excel Application object, allowing direct access to this property. The property accepts and returns a Boolean value (<code>True<\/code> or <code>False<\/code>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Parameter\/Value Description:<\/strong><br>The property is a read\/write Boolean. The values correspond to the following behaviors:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Value<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>True<\/code><\/td><td>The left and right arrow keys move the active cell one column left or right (standard Excel navigation).<\/td><\/tr><tr><td><code>False<\/code><\/td><td>The left and right arrow keys move the active cell to the next non-blank cell in the pressed direction (Lotus 1-2-3 navigation).<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Example:<\/strong><br>The following xlwings script demonstrates how to check the current setting, change it, and observe its effect. The example assumes Excel is already running with a workbook open.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\n# Connect to the active Excel application\napp = xw.apps.active\n\n# Print the current TransitionNavigKeys setting\ncurrent_setting = app.api.TransitionNavigKeys\nprint(f\"Current TransitionNavigKeys setting: {current_setting}\")\n\n# Change the setting to False (Lotus 1-2-3 mode)\napp.api.TransitionNavigKeys = False\nprint(\"TransitionNavigKeys has been set to False (Lotus 1-2-3 navigation).\")\n\n# Perform a simple action: select cell A1 and simulate a right arrow key press.\n# Note: xlwings itself does not simulate key presses. This change affects manual keyboard interaction in Excel.\n# To demonstrate, we can inform the user to test manually.\nsheet = app.books.active.sheets.active\nsheet.range('A1').select()\nprint(\"Cell A1 is selected. Now, manually press the right arrow key in Excel.\")\nprint(\"With TransitionNavigKeys=False, it will jump to the next non-blank cell to the right, not cell B1.\")\n\n# Revert to standard Excel navigation\napp.api.TransitionNavigKeys = True\nprint(\"TransitionNavigKeys has been reverted to True (standard Excel navigation).\")\n\n# Save the setting change (optional, as this is an Application-level property)\n# app.api.ActiveWorkbook.Save()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Application.TransitionNavigKeys property in Excel is a legacy feature that determines whether ce&#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-2207","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2207","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=2207"}],"version-history":[{"count":1,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2207\/revisions"}],"predecessor-version":[{"id":3374,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2207\/revisions\/3374"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}