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.
- Windows 7 x64, MS Office 2013 Pro/365 ProPlus
- It is a C# application. It is compiled with VS2010 for .NET 4.0, but the problem exhibits even when the app is compiled with VS2012 for .NET 4.5. With use of different versions of Microsoft.Office.Interop.Excel.dll.
There are three facts I consider important:
- The application works on other computers, so it is not the application what is a cause of the problem.
- The application doesn't work even after re-installation of (a slightly different version of) excel (2013), so it is probably not a problem of excel itself.
- I used the SysInternals' ProcessMonitor to find out that the application really succeeds in instantiating the excel, and the excel successfully(?) reads the .xlsx file. But then excel fails.
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).
- Here are some of the links I found, but there are no suggestions given, or they didn't help: link1, link2,... (cannot post more than 2 links)