Getting factory COM class for component with CLSID {00024500-0000-0000-C000-000000000046} failed when exe was configured in task scheduler

I created a console application in C # to read an Excel file. Used microsoft dll dll to manage excel file. An excel file is created in Excel 2013.net version 4.5 OS: Windows Server 2012

It will open the excel file and add a string sheet with values.

Functionality is working fine. But when I configure exe in the task scheduler, I get an error message.

Retrieving the factory COM class for a component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

I also tried running exe on the command line with the same user credentials that were used to configure the task in the scheduler.

My question is: exe works fine on the command line, but doesn't work on the task scheduler.

Any thoughts ??

0
source share
1 answer

Option1:

Try the following steps

  • In DCOMCNFG, right-click My Computer and select properties.
  • Select the COM Securities tab
  • In "Access Permissions", click "Change Default Settings" and add the network service to it and give the permission "Allow Local Access". Do the same for \ Users.
  • " " " " " ". \Users

, -

2:

, Save AS

+2

All Articles