小编Amr*_*ita的帖子

使用C#代码打开Excel工作簿时出错

我正在尝试打开一个excel工作簿并尝试在其中获取工作表.Excelapp.workbooks.Open行正在抛出异常

来自HRESULT的System.Runtime.InteropServices.COMException:Microsoft.Office.Interop.Excel.Workbooks.Open中的0x800A03EC

这是我的代码:

Excel.Application excelApp = new Excel.ApplicationClass();
Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(strWBPath, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,Type.Missing, Type.Missing, Type.Missing, true);
Run Code Online (Sandbox Code Playgroud)

StrWbPath是我的Excel位置.我正在引用2007 excel并添加了版本12.0.0.0的Microsoft.office.interop.excel.

c# excel-2007

8
推荐指数
2
解决办法
2万
查看次数

标签 统计

c# ×1

excel-2007 ×1