{"id":2082,"date":"2026-05-24T16:20:29","date_gmt":"2026-05-24T08:20:29","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=2082"},"modified":"2026-03-28T06:15:09","modified_gmt":"2026-03-28T06:15:09","slug":"how-to-use-applicationdisplaydocumentinformationpanel-in-the-xlwings-api-way","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-use-applicationdisplaydocumentinformationpanel-in-the-xlwings-api-way\/","title":{"rendered":"How to use Application.DisplayDocumentInformationPanel in the xlwings API way"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The Application.DisplayDocumentInformationPanel property in Excel&#8217;s object model controls the visibility of the Document Information Panel (DIP) for the active workbook. This panel, when visible, typically displays metadata properties of the document based on its associated content type or custom XML parts. In xlwings, this functionality is exposed through the <code>api<\/code> property, which provides direct access to the underlying Excel VBA object model. Using this property, you can programmatically check whether the panel is currently displayed or change its visibility state, which can be useful in automation scripts that manage the user interface or document properties workflow.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Functionality<\/strong><br>The primary function is to get or set a Boolean value indicating if the Document Information Panel is visible. This can help in UI automation, ensuring a consistent interface state, or in processes where metadata entry or review is required.<\/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># To get the current visibility state\nvisible = xw.apps&#91;0].api.DisplayDocumentInformationPanel\n\n# To set the visibility state (True to show, False to hide)\nxw.apps&#91;0].api.DisplayDocumentInformationPanel = True<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Property Type<\/strong>: Read\/write Boolean.<\/li>\n\n\n\n<li><strong>Return Value<\/strong>: When getting, it returns <code>True<\/code> if the panel is visible; otherwise, <code>False<\/code>.<\/li>\n\n\n\n<li><strong>Parameter for Setting<\/strong>: A Boolean value (<code>True<\/code> or <code>False<\/code>). Setting it to <code>True<\/code> displays the panel; <code>False<\/code> hides it. Note that the effect might depend on the workbook&#8217;s properties and Excel&#8217;s configuration.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Code Examples<\/strong><br>Here are practical xlwings API examples demonstrating its usage:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Check and Report Current Visibility<\/strong><\/li>\n<\/ol>\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# Get the current state of the Document Information Panel\nis_visible = app.api.DisplayDocumentInformationPanel\n\n# Output the result\nif is_visible:\n    print(\"The Document Information Panel is currently visible.\")\nelse:\n    print(\"The Document Information Panel is currently hidden.\")<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Toggle the Panel Visibility<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\napp = xw.apps.active\n\n# Toggle the visibility: if visible, hide it; if hidden, show it\ncurrent_state = app.api.DisplayDocumentInformationPanel\napp.api.DisplayDocumentInformationPanel = not current_state\n\nprint(f\"Toggled the panel. New state: {app.api.DisplayDocumentInformationPanel}\")<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Ensure the Panel is Hidden for a Clean UI<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>import xlwings as xw\n\n# Start or connect to Excel\napp = xw.App(visible=True) # Make Excel visible\napp.books.add() # Open a new workbook\n\n# Force the Document Information Panel to be hidden\napp.api.DisplayDocumentInformationPanel = False\n\nprint(\"Document Information Panel has been hidden.\")<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Application.DisplayDocumentInformationPanel property in Excel&apos;s object model controls the visibi&#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-2082","post","type-post","status-publish","format-standard","hentry","category-xlwings-api-reference"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2082","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=2082"}],"version-history":[{"count":1,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2082\/revisions"}],"predecessor-version":[{"id":3186,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/2082\/revisions\/3186"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=2082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=2082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=2082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}