<pre> Line 415: //--------------------------------------------------------------------------------------------------- Line 416: <font color="red">Line 417: Excel.Application app = new Excel.Application(); </font>Line 418: Line 419: // create the workbook object by opening the excel file.</pre>
<pre> [UnauthorizedAccessException: 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)).] System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType) +0 System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType) +79 System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj) +76 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241 System.Activator.CreateInstance(Type type, Boolean nonPublic) +69 System.Activator.CreateInstance(Type type) +6 IntegratedTaxSystem.Handlers.IncomeTax.DocumentUploadD03.UploadForAnx13() in C:\inetpub\wwwroot\ITS Live\ITS\IntegratedTaxSystem\IntegratedTaxSystem\Handlers\IncomeTax\D03\DocumentUploadD03.ashx.cs:417 IntegratedTaxSystem.Handlers.IncomeTax.DocumentUploadD03.ProcessRequest(HttpContext context) in C:\inetpub\wwwroot\ITS Live\ITS\IntegratedTaxSystem\IntegratedTaxSystem\Handlers\IncomeTax\D03\DocumentUploadD03.ashx.cs:73 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 </pre>
Sometimes, you create new application pool and can’t solve it via DCOMCNFG. Then there is another method to do: Set the Identity (Model Name) of application pool to Local System.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)