title: Excel workbook.saveas inside IIS
body: <p>I have a problem when I published web application in IIS</p>
  <p>sometimes the WorkBook.SaveAs method works fine, sometimes not.</p>
  <blockquote>
  <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.</p>
  <p>Exception Details: System.Runtime.InteropServices.COMException: The remote procedure call failed. (Exception from HRESULT: 0x800706BE)</p>
  </blockquote>
  <p>Source Error:</p>
  <pre><code>    workbook.Saved = True
      workbook.SaveAs(Server.MapPath(&quot;~/MyFolder/Excel.xlsx&quot;))
      workbook.Close()
      APP.Quit()
  </code></pre>
  <p>and sometimes the error is on APP.Quit</p>