how to solve Exception:Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED)) in C#?

Manoj Nayak picture Manoj Nayak · Dec 11, 2013 · Viewed 78.9k times · Source

I have written a C# code in console application to open two excels and copy and paste data from one excel to another excel. It was working fine until the destination excel's visibility was true. But I need to hide the excel at the time of execution. So I changed the visibility to false. Like,

  _destExcelApp = new Excel.ApplicationClass();
  _destExcelApp.Visible = false;

Now its showing an exception like

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

How to solve this one?

Answer

Crash5998 picture Crash5998 · Feb 19, 2014

I ran into this same error being thrown when I deployed my application onto a machine without a fully activated and licensed installation of Excel. I spent hours trying to diagnose the issue. Make sure you check your Office installations to make sure they are complete.