当我尝试打开 Excel 文档时出现此错误
System.Runtime.InteropServices.COMException (0x800706BE):远程过程调用失败。
我为我的公司构建了一个应用程序,它在每台计算机上都能正常工作,但在我老板的计算机上,当他的应用程序必须打开 Excel 文档时,它就停止工作了。
我曾尝试更改组件服务中的权限,但没有解决。
我正在使用 Windows 7。
Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
object missing = Type.Missing;
Excel.Range xlRange;
Excel.Sheets xlSheets = null;
Excel.Worksheet xlSheet = null;
Excel.Workbook xlWorkbook = null;
xlWorkbook = excelApp.Workbooks.Open(filePath, missing, missing, missing,
missing, missing, missing, missing, missing, missing, missing,
missing, missing, missing, missing);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1348 次 |
最近记录: |