title: VBA Closing Excel Files
body: <p>Say I have some VBA code in Access that uses excel for whatever reason.  Sometimes I have trouble closing the file properly.</p>
  
  <p>The code (I think) should look somewhat like this:</p>
  
  <pre><code>WBO.Close savechanges:=True
  Set WBO = Nothing
  
  XLO.Application.Quit
  Set XLO = Nothing
  
  rs.Close
  db.Close
  </code></pre>
  
  <p>Here XLO is an excel object, WBO is a workbook object, rs is a DAO recordset and db is a DAO database.  Even though the physical excel file closes there's still an "EXCEL.EXE" process occurring on my system, which stops me from running my program twice in a row.  Does anyone know why this happens?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I took out the <code>rs.Close</code> and then <code>db.Close</code> lines since I decided to manually export the data I was using from Access to Excel (there's too many rows and columns to copy each cell over efficiently).  However, this didn't change the problem at hand.</p>
  
  <p>Thank you,</p>
  
  <p>Jesse Smothermon</p>