when I use Interop to open an Excel file using this code
Microsoft.Office.Interop.Excel.Application app = new Microsoft.Office.Interop.Excel.Application();
app.Visible = false;
Workbook wb = app.Workbooks.Open(ruta,Type.Missing ,false);
Worksheet sh = wb.Sheets["Scenarios"];
I got the following error.
`An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred
Additional information: El servidor lanzó una excepción. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))`
But if instead putting app.Visible = false
I use app.Visible=true
everything works perfectly.
Why is that error? obviously what I want is open an excel file but without showing the window so the user doesn't see all the back-end process
User contributions licensed under CC BY-SA 3.0