Marshal.GetActiveObject("Excel.Application") give Error Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

1

I have C# application using Microsoft.Interop.Excel and Microsoft.Interop.Word. We have validation that either word or excel one should be open at a time. When on Excel instance open out side of application with Active Cell - in Writing mode then

I call Marshal.GetActiveObject("Excel.Application") to crate instance of Excel but at that time it will give error

Marshal.GetActiveObject(progId);

give Error Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))

Please give me suggestion so i am able to get object of Excel.

c#-4.0
office-interop
excel-2010
excel-interop
asked on Stack Overflow Feb 12, 2013 by KuldipMCA

1 Answer

0

Both Excel & Word are single threaded applications. I've gotten that error before because I had Auto Save on Excel turned on. You might want to turn that off and see if that fixes the issue.

DD

answered on Stack Overflow Feb 13, 2013 by dduphorn

User contributions licensed under CC BY-SA 3.0