Excel automation through Windows Task Scheduler throwing an error - 80080005 Server execution failed

1

We have a console application to automate the excel data refresh everyday at a particular time of the day. It is working fine when we switch off the office updates. But when an office update happens, immediately this stops working and throwing this error:

"exception Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))."

But when we try to execute the same console application through command prompt, it is working fine and when the same is scheduled through SQL agent, then also it is working fine. Only the task that scheduled in the Task Scheduler is not working.

Workaround tried so far:

  1. Set the Microsoft Excel Component's identity to "The Interactive user". This is working fine when a user is logged on to the server. So, this cannot be a permanent solution.

  2. Tried to create the following folders in the windows directory.

    "C:/Windows/System32/config/systemprofile/Desktop", "C:/Windows/SysWOW64/config/systemprofile/Desktop",

still it is not working.

I am using Microsoft Excel 2016 and the server is Windows Server 2016.

Any leads on this will be very helpful.

excel-2016
windows-task-scheduler
office-automation
asked on Stack Overflow Dec 15, 2020 by SKV • edited Dec 16, 2020 by M. Mohabbati

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0