title: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed. error: 80070005 Access denied
body: <p>In my website, i am creating Outlook objects and using them to open an outlook file on a button click. It works locally. but when i host it in IIS 8.5 it gives me the following error</p>
  
  <p><strong>Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).</strong></p>
  
  <p>My code is as follows:</p>
  
  <pre><code>outlook.Application objOutlk = new outlook.Application();
  string templatePath = Server.MapPath("Files\\" + file + ".msg");
  outlook._MailItem mailitem =   
  (outlook.MailItem)objOutlk.CreateItemFromTemplate(templatePath);
  mailitem.Display(true);
  </code></pre>