COMException (0x80010108 - RPC_E_DISCONNECTED) When Closing Excel.Workbook

霸气de小男生 提交于 2019-12-06 00:25:45
Todd Main

RPC_DISCONNECTED...the dreaded "The object invoked has disconnected from its clients." issue. There are a ton of causes to this, looks like you've covered the global variables issue with Excel.. Can you put the first ReleaseCOM(ReportSheet) below ReportBook(Close) and run it? Also, check out this.

I cannot say why it is failing based on the code you are showing.

Have you considered switching from Excel Automation using COM Interop to a 3rd party component?

SpreadsheetGear for .NET will let you load Excel workbooks and get values / get formatted text / recalculate formulas / etc... without the troubles associated with COM Interop.

You can see live ASP.NET samples here and download the free trial here if you want to try it yourself.

Disclaimer: I own SpreadsheetGear LLC

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!