I\'ve been trying to write some code to interact with Photoshop, both by adding a COM reference and by late binding. It took me a while to realise that the code did work, but no
Assuming from the little information we have:
Quoted from: When CoCreateInstance returns 0x80080005 (CO_E_SERVER_EXEC_FAILURE)
... If the client fails to call CoRegisterClassObject() from the moment the process was started, or fails to call CoRegisterClassObjects() at all for the given class factory, then the client will receive the CO_E_SERVER_EXEC_FAILURE error in CoCreateInstance(...). This can happen for a variety of reasons:
1) The machine has a high CPU load and the process takes a long time to start and execute the CoRegisterClassObjects() in less than 120 seconds.
2) The COM server doesn't register for the right class IDs.
3) The COM server is currently stopping and there is a race condition between CoCreateInstance and the COM server stopping part.
4) There is a security problem in the way the COM server is started (this page seems to suggest misspelled passwords or lacking the "Login as Batch Job" privilege for "Run As.." COM servers, but anyway I would suggest re-verifying this information for your specific configuration)