title: "Retrieving the COM class factory for component.... error: 80070005 Access is denied." (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
body: <p>I just created a simple application and hosted in <strong>IIS6.0</strong>. In code I'm just instantiating excel objects.</p>
  
  <pre><code>using excel = Microsoft.Office.Interop.Excel.Application;
  
  namespace TestHosting
  {
      public partial class WebForm1 : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
              excel excelObj=new Microsoft.Office.Interop.Excel.Application();
          }
      }
  }
  </code></pre>
  
  <p>Its giving me following error</p>
  
  <pre><code> "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)).
  </code></pre>
  
  <p>System Configuration:</p>
  
  <p><strong>Windows server 2008,enterprise edition with 64 bit.</strong>
  service pack 2</p>
  
  <p>I tried with many possible solutions  found on internet,but none of them were worked for me.</p>
  
  <p>Some solution I tried are below</p>
  
  <p><strong>1) creating Desktop application under the path "C:\Windows\SysWOW64\config\systemprofile"
  2)setting full permission/control for Microsfot.EXcelApplicaiton in DCOMCNFG
  3)Killing all excel instances in Task Manager</strong></p>
  
  <p>Please help me in this regard,this is just sample app but in my original app is mostly about read and writing data from/to excel.</p>