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??