COM Exception - Call was rejected by callee and The runtime has encountered a fatal error

-2

In my VB.NET application I have a class called Letter. In the constructor of the Letter class I initialize new word.application object.

Sub New()
    _application = New Word.Application
End Sub

Recently I started to get a COM exception/error - Call was rejected by callee. After doing my research I have implemented the solution suggested in the following link:

Call was rejected by callee PowerPoint Automation

After the implementation I have the following code:

Sub New()
    MessageFilterAPI.RegisterMessageFilter()
    _application = New Word.Application
    MessageFilterAPI.RevokeMessageFilter()
End Sub

This stopped error appearing on my machine (dev environment), but other machine where the software is installed still gets the error. Full exception message:

Creating an instance of the COM component with CLSID {000209FF-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 80010001 Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

When debugging on the initializing line _application = New Word.Application program completely crashes and freezes with the following exception:

The runtime has encountered a fatal error. The address of the error was at 0x74444ba1, on thread 0x5e48. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

Anyone has an idea why this is happening? This code hasn't been changed in years and it suddenly became an issue.

vb.net
com
ms-word
asked on Stack Overflow May 28, 2015 by Rasa Rin • edited May 23, 2017 by Community

1 Answer

2

This is usually memory issues or corrupted installation. So I'll try to reinstall Office and run "memtest86" to test memory on machine, that shows 0xc0000005 error

answered on Stack Overflow May 28, 2015 by Alexander

User contributions licensed under CC BY-SA 3.0