无法在Application.Run上debuggingSystem.Runtime.InteropServices.COMException
我有一个Excel函数,我从C#调用如下:
string result = xlApp.Run("'ExcelBook.xlsm'!mainFromBatch", "http://someSite/TestFile.xlsm", false, "T:\\somePath");
运行时会产生一个错误:
An exception of type 'System.Runtime.InteropServices.COMException' occurred in BatchConverter.exe but was not handled in user code Additional information: Exception from HRESULT: 0x800ADF09 If there is a handler for this exception, the program may be safely continued.
mainFromBatch
的函数头是:
Function mainFromBatch(sourceBkPath As String, Flag As Boolean, _ Optional outputPathFromConfig As String) As String
当我在ExcelBook.xlsm
的VBA代码中的这个函数头上放置一个断点时,C#代码引发了错误,但是达到了Excel断点,Excel暂停了,就好像没有发生错误,并且准备好执行其余的代码。
我可以使用C#从这个工作簿中调用其他函数,没有任何问题。
我尝试使用GooglesearchHRESULT代码,但没有find任何东西。
任何想法发生了什么?
- Microsoft Excel不能访问文件“…”。 Windows Server 2008 R2与Microsoft Office 2010有几个可能的原因
- Excel Interop未能写入(HRESULT:0x800A03EC)
- 其他工作簿select图表时Excel.Worksheet.Copy上的COMException错误
- 如何使用VSTO顺利地从C#到Excel的数据,并返回
- 从Asp.net webform应用程序导出griddata到MS excel时出错
- 使用C#读取Excel文件
- f#读取xls文件 – 如何parsing一个value2对象
- 无法更新。 数据库或对象是只读的
- excel到XML – 显示一些错误纠正我\