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

前端 未结 12 1139
梦谈多话
梦谈多话 2020-11-30 13:43

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\'

相关标签:
12条回答
  • 2020-11-30 14:04

    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.

    0 讨论(0)
  • 2020-11-30 14:05

    I ran into this issue with Word and my solution was uninstalling OpenOffice. I'm not sure if there's another solution but most likely has to do with the dlls and a conflict with the default file handler for the particular files you are generating programmatically.

    0 讨论(0)
  • 2020-11-30 14:07

    I was facing the same error and many solutions suggested were not working for me. I had an application running in windows 8 and I found that the problem was Excel always asking to choose default application for "xlsx" extensions. When executing the application no window dialog appeared, just the error was shown.

    I solved the problem going to Control Panel > Programs > Default Programs and setting Microsoft Office Excel 2016 as default program for xlsx files.

    0 讨论(0)
  • 2020-11-30 14:09

    I can offer another thing to look out for in addition to the solutions above, which seem to converge on this comment (on an answer by Alielson Piffer),

    SUMMARY: So by the answers here we could conclude that this error may occur when Excel is showing any message in a popup window like for example "This software is not activated" or "Do you want Excel to be the default application for DOCX files?". – Elmue Jun 12 '17 at 22:43

    There were no open messageboxes or prompts but there was an unended process (Word.exe in my case) in task manager that I needed to end. That fixed it.

    This would explain why a restart helped another user.

    0 讨论(0)
  • 2020-11-30 14:11

    Make sure you check your Office installations to make sure they are complete.

    otherwise try following

    try App visibleity false after the all Data is writin then turn on the Visibility ex Dim wapp As new excel.Application .... . . wapp.Visible = false

    'do your writing .. . . . .

    'then turn on your visibility

    wapp.Visible = True

    0 讨论(0)
  • 2020-11-30 14:14

    I agree with those that say excel license must be activated, I had the same problem and I activated the license everything works fine - Papiki

    0 讨论(0)
提交回复
热议问题