开发者

RPC_E_SERVERFAULT error on oppening an Excel file in asp.net

开发者 https://www.devze.com 2023-02-24 21:07 出处:网络
I\'m trying to open an Excel file to get and set some values. Unfortun开发者_开发技巧ately, I have no choice, I must to work with Excel.

I'm trying to open an Excel file to get and set some values. Unfortun开发者_开发技巧ately, 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消