title: Error E_ACCESSDENIED in C# Microsoft.Office.Interop.Excel()
body: <p>I have created a <strong>windows service</strong> that repetitively updates the same <strong>excel file</strong>. While running the Windows Service, I am receiving the following <strong>Error</strong>:</p>
  
  <blockquote>
    <p>Error Message Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).</p>
  </blockquote>
  
  <p>This error is thrown at the following line of code:</p>
  
  <pre><code>ExcelApp =  new Microsoft.Office.Interop.Excel.Application();
  </code></pre>
  
  <p>Is there a work-around for this ?</p>
  
  <p>I followed the steps mentioned in the following <a href="https://stackoverflow.com/questions/17785063/retrieving-the-com-class-factory-for-component-error-80070005-access-is-de"><strong>SO link</strong></a> but that didn't helped me overcome these error. I tried solution from few other questions as well and none of them worked for me.</p>