We have a C# application that internally invokes excel. It does so using Microsoft.Office.Interop.Excel.dll. The application works on most computers with Excel, but not on mine.
Originally, the application was failing with HRESULT 0x800706BE (The remote procedure call failed). I'd tried almost every advice found on the web, but without success. Then I uninstalled my MS Office 2013 Pro, and installed Office 365 v2013. The application still fails on the same line of code, but now with HRESULT 0x80010105 (RPC_E_SERVERFAULT).
Is there any advice you can give to make the excel interop working? My guess is that some Windows service is not started or a DCOM component is not registered. But I don't know which one.
Details:
There are three facts I consider important:
I also used the VS2010 debugger to find out what's going on:
This is the core of the code. It fails on the last line in Open:
using Excel = Microsoft.Office.Interop.Excel;
object misValue = System.Reflection.Missing.Value;
Excel.Application myExcelApp = new Excel.Application();
myExcelApp.Visible = false;
myExcelWorkbooks = myExcelApp.Workbooks;
myExcelWorkbook = myExcelWorkbooks.Open(xlsxFileFullPath, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue, misValue);
There is nothing relevant in the Windows event log (at the time the app fails).
After a long research I succeeded to solve this problem due to this link. Essentially, the problem was caused by a third-party Excel COM plug-in, in my case it was "FoxitReader PDF Creator COM Add-in". After disabling it, the problem was gone!
How to disable the plugin: Excel > File > Options > Add-ins > Manage, then choose "COM add-ins" > Go. And then untick the problematic plugin.
I had the exact same issue as xarx. Suddenly an application I created stopped working on certain PCs. The code it was crashing on was:
Dim fname As String = "B:\Data Warehouse\Lists\WarehouseLists.xls"
Try
xlWorkBookList = xlAppLists.Workbooks.Open(fname,, False) 'open the raw data sheet
Catch ex As Exception
MessageBox.Show(ex.Message)
Exit Sub
End Try
Disabling the Foxit Reader add-in immediately fixed the issue.
User contributions licensed under CC BY-SA 3.0