我正在尝试打开一个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.