Consultor Eletrônico



Kbase P148238: Creating ActiveX automation object fails with COM error "Operation Unavailable" (Error code: 0x80040
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   23/06/2009
Status: Unverified

SYMPTOM(s):

Creating ActiveX automation object fails with COM error "Operation Unavailable" (Error code: 0x800401e3)

Error occurred while creating/connecting to automation server for: <automation object name>.
Operation Unavailable
Error code: 0x800401e3 <Program name> (5894)

Error occurred while creating/connecting to automation server for: <automation object name>. <COM message> Error code: <Program name> (5894)

FACT(s) (Environment):

Progress/OpenEdge Product Family
Windows

CAUSE:

This particular COM error occurs when trying to create an automation object with the CONNECT option, if there is no process running that would supply the object.

For example, this will occur when running the code:
CREATE "Word.Application" wordprog CONNECT.

While no instance of Microsoft Word is currently running.

FIX:

One way to handle this error is to trap it when it occurs, and then force the process to be instantiated by using the CREATE "automation object" without the CONNECT option.

Following the example above, the code to do this would be similar to:

DEFINE VARIABLE wordprog AS COM-HANDLE.
CREATE "Word.Application" wordprog CONNECT NO-ERROR.
IF ERROR-STATUS:ERROR THEN CREATE "Word.Application" wordprog.