Error from scheduled task, only if not logged in

3

I've written an application which creates Word documents from a template. I had a bunch of issues getting that function to work, but I did it by editing permissions Component Services permissions. Now it works if I manually click the executable, or if the Task Scheduler runs it while I'm logged in, but not if I have it scheduled to run and I'm logged out.

It runs but breaks, and Task Scheduler reports an 0xE0434352 error. I've retrieved this error message by catching the exception: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a The server process could not be started because the configured identity is incorrect. Check the username and password. (Exception from HRESULT: 0x8000401A).

Task Scheduler says it is running as DOMAIN\Administrator, and that's the account I log in with when I can successfully run the executable. I have it set to run whether I'm logged in or not and with the highest privileges.

It looks to me like somehow Task Scheduler doesn't have the password or permissions it needs to do the Office Interop stuff. But, obviously my understanding is insufficient. Any ideas?

c#
scheduled-tasks
office-interop
asked on Stack Overflow Nov 13, 2014 by erosebe

1 Answer

0

I had to change a setting for Office in Component Services. I set it to run as the Launching user instead of an interactive user.

answered on Stack Overflow Nov 18, 2014 by erosebe

User contributions licensed under CC BY-SA 3.0