As the title says, I have a C # console application that uses interop to open Excel and create a new workbook. The code works fine when starting a console application through the command line. However, this exception occurs when starting a console application using a scheduled task:
System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005
It is called from the following call:
_xlApp = new Excel.Application()
The scheduled task is configured to use my credentials (I am an administrator). Based on other forums, I made sure that I had full control over my account in Component Services β Computers β My Computer β DCom Config β Microsoft Excel, but no luck.
I am on Windows 7 Enterprise 64 bit. Not sure what the next step should be; any help is appreciated.
source share