title: Why do files remain in project window even after files closed?
body: <p><strong>Scenario</strong></p>
  
  <p>I have a userform, and when a button is pressed, it opens an Excel file as read-only, gets some values, and closes that file. Following are the codes I am using to open and close the file.</p>
  
  <p>To open: <code>Set planbook = Workbooks.Open(planFilePath, ReadOnly:=True)</code></p>
  
  <p>To close: <code>planbook.Close False</code></p>
  
  <p><strong>Problem</strong></p>
  
  <p>After closing the file, I see that file in the project window, for each time I press the button.</p>
  
  <p><a href="https://i.stack.imgur.com/yxq1k.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yxq1k.jpg" alt="Modules show after closed Planner file.xlsx"></a></p>
  
  <p>It is using a lot of memory. Due to this, Excel hangs intermittently. </p>
  
  <p>Why are files opened earlier but currently closed still appearing in the project window?</p>
  
  <p>Note, when the button is pressed three times (means open and close a workbook three times), and thus there are three files listed in the picture.</p>
  
  <p><strong>Edit 1</strong><br>
  It's not the module that remains, the whole file is visible in the VBA window, although the workbook is closed.</p>
  
  <p><strong>Edit 2</strong><br>
  Noticed, if I keep the macro open for some time, the files showing in the project window, disappear one by one. </p>
  
  <p><strong>Edit 3</strong><br>
  I found, the issue is due to opening and closing a shared workbook. See the answer for more explanation.</p>