title: Is the MS-Access Navigation Pane visible?
body: <p>The following code to close the Access Navigation Pane works.</p>
  
  <pre><code>DoCmd.NavigateTo "acNavigationCategoryObjectType"
  DoCmd.RunCommand acCmdWindowHide
  </code></pre>
  
  <p>But the problem is that if the Navigation Pane is already closed then the acCmdWindowHide will just hide any other object (i.e. form, table) which was open.
  I use DoCmd.TransferDatabase in my code and when this is executed the Navigation Pane is sometimes opened. This may happen if a warning message about data import appears and the user clicks cancel. To be sure the user does not see the pane I want to hide it but if it is already hidden then there is nothing to hide but the above command just hides my form and that is not what I want.</p>
  
  <p>The line</p>
  
  <pre><code>DoCmd.NavigateTo "acNavigationCategoryObjectType"
  </code></pre>
  
  <p>is always executed and does not return anything. It does not return an error if there is no Navigation Pane to navigate to.</p>
  
  <p>My question is: How can I determine if the Navigation Pane is currently open so that I know I have to close it.
  Or how can I make sure that I close the Navigation Pane but no other object if I use the above code?</p>