Excel can not be activated from a Service or the Task Scheduler
This applies to any program type including c#, VB, PowerShell etc. that uses OLE Automation.
There are many different solutions/configurations.
Please be EXTREMELY careful when modifying the windows configuration.
Here is the most common solution – Please note that it does NOT work for all configurations. So you have to experiment a bit.
Open Component Services (Start -> Run, type in dcomcnfg)
Drill down to Component Services -> Computers -> My Computer and click on DCOM Config
Right-click on Microsoft Excel Application and choose Properties.
Some times “The interactive user” works .. and sometimes “The user”.
Make sure the following folders exists.