我正在开发Excel-DNA的帮助下的Excel加载项,并且遇到超过255个字符的公式存在问题。我正在从不同代号的API中提取数据,在调用Array Resizer之前,这一切都很好。在DoResize()
函数异常是在下面的代码行抛出。对Excel公式使用Excel-DNA ArrayResizer样本超过255个字符
//Set the formula into the whole target
formulaR1C1 = (string) XlCall.Excel(XlCall.xlfFormulaConvert, formula, true, false, ExcelMissing.Value, firstCell);
和异常描述如下:
Exception Type: System.InvalidCastException
Exception Message: Unable to cast object of type 'ExcelDna.Integration.ExcelError' to type 'System.String'.
我使用Excel 2013的32位与Excel-DNA 0.30。
请参阅关于Excel-DNA Google小组的讨论:https://groups.google.com/forum/#!topic/exceldna/URF0fiIZnjg – Govert