RPC_E_SERVERFAULT error on oppening an Excel file in asp.net

1

I'm trying to open an Excel file to get and set some values. Unfortunately, I have no choice, I must to work with Excel.

Dim xAp As New Microsoft.Office.Interop.Excel.Application
Dim xWkb As Microsoft.Office.Interop.Excel.Workbook

xWkb = xAp.Workbooks.Open("c:\uploads\teste.xls")

Always I have this exception: (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

Need I Excel installed in server machine to open Excel files? I don't think so, because when I create a new application and workbook throught code, all things go right, but... its a possibility...

Thanks for helping.

asp.net
vb.net
excel
vba
asked on Stack Overflow Apr 13, 2011 by Alex • edited Jul 9, 2018 by Community

1 Answer

2

Yes, you need Excel installed on the server to open Excel files using COM Interop. It's not recommended, and I would recommend using a 3rd party library to access data in Excel files. You can also try and put the data into an easier-to-work with CSV, though you stated this might not be possible.

answered on Stack Overflow Apr 13, 2011 by David J. Sokol

User contributions licensed under CC BY-SA 3.0