asp.net - "Retrieving the COM class factory for component.... error: 80070005 Access is denied." (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) -


i created simple application , hosted in iis6.0. in code i'm instantiating excel objects.

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();         }     } } 

its giving me following error

 "retrieving com class factory component clsid {00024500-0000-0000-c000-000000000046} failed due following error: 80070005 access denied." (exception hresult: 0x80070005 (e_accessdenied)). 

system configuration:

windows server 2008,enterprise edition 64 bit. service pack 2

i tried many possible solutions found on internet,but none of them worked me.

some solution tried below

1) creating desktop application under path "c:\windows\syswow64\config\systemprofile" 2)setting full permission/control microsfot.excelapplicaiton in dcomcnfg 3)killing excel instances in task manager

please me in regard,this sample app in original app read , writing data from/to excel.

  1. make sure have office runtime installed on server.
  2. if using windows server 2008 using office interops lenghty configuration , here steps.

better move open xml or can configure below

  • install ms office pro latest (i used 2010 pro)
  • create user exceluser. assign worduser admin group
  • go computer -> manage
  • add user below options
  • user options password never expires
  • password cannot change

com+ configuration

  • go control panel - > administrator -> component services -> dcom config
  • open microsoft word 97 - 2003 properties
  • general -> authentication level : none
  • security -> customize 3 permissions allow everyone
  • identity -> user -> use exceluser /password
  • launch excel app make sure fine

3.change security settings of microsoft excel application in dcom config.

controlpanel --> administrative tools-->component services -->computers --> mycomputer -->dcom config --> microsoft excel application.

right click properties dialog. go security tab , customize permissions

see posts here: error while creating excel object , excel manipulations in wcf using com


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -