Reputation: 1417
I have created console application in C# to read a Excel file. Used microsoft interop dll to manipulate excel file. The excel file is created in Excel 2013. .net version is 4.5 OS : windows server 2012
It will open the excel file and add a row sheet with values.
The functionality is working fine. But when I configure the exe in task scheduler I am getting an error.
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)).
Also I have tried to run the exe in command prompt with the same user credential which was used to configure the task in scheduler.
My Question is, the exe working fine in the command prompt but not working in task scheduler.
Any thoughts??
Upvotes: 3
Views: 16752
Reputation: 1
Check DCOMCNFG whether CLISID is "00024500-0000-0000-C000-000000000046" or "00020812-0000-0000-C000-000000000046". If it is "00020812-0000-0000-C000-000000000046" then you need to update it in RegEdit.
Upvotes: -1
Reputation: 6585
Option1:
Try the following steps
Have a look into this link if there any permission problems
Option 2:
if you can't find the reason, just switch your solution as Save AS method
Upvotes: 3