title: VBA "ThisWorkbook.Close" Does not close this workbook!
body: <p>I'm Writing a VBA macro in excel that is supposed to open "fileB.xls" and then close immediately after it opens. Since we will be talking about 3 excel files I'll call the first one fileA.</p>
  
  <p>The code for the buttons on the userform for file A look like the following.</p>
  
  <pre><code>Private Sub CommandButton2_Click()  
      'Code for Button in FileA '
      Workbooks.Open Filename:="File Path/fileB.xls"  
      ThisWorkbook.Close  
  End Sub
  </code></pre>
  
  <p>Once "fileB.xls" opens it launches a form to collect some user information.</p>
  
  <p>However the original file does not close after, "fileB.xls" is opened. </p>
  
  <pre><code>Sub Workbook_Open()
      'Code in FileB '
      'Display a form to obtain information from the user.  '
      frmOpenFile.Show  
  End Sub
  </code></pre>
  
  <p>It might be worth noting that fileB opens a third and final excel file (FileC). Code that is similar to FileA's code is used in FileB and work fine when launching FileC (FileB closes fine). </p>
  
  <p>The idea is that there is one "master" file where you choose which form you need to fill out. This master file then closes itself and lets the user fill out the form, and based upon user input a final excel file is opened. </p>
  
  <p>So, just to reiterate the problem, FileA opens, launches a userform, the user clicks on a button, File B lauches, FileA does not close when it should.</p>
  
  <p>I would be grateful for any help! </p>
  
  <p>EDIT: I should note that if rewrite FileA to directly open FileC, FileA closes correctly. Could the user form from FileB prevent File A from closing? </p>