Problem with UDF having more than 255 characters

Mar 19, 2014 at 8:34 AM
Hi All,

I am developing an excel add-in with the help of excel-dna and facing a problem with the UDF having more than 255 characters. I am pulling data from API of different tickers, all is good until Array Resizer is called. In the DoResize() function exception is thrown at the following line of code.
// Set the formula into the whole target
formulaR1C1 = (string) XlCall.Excel(XlCall.xlfFormulaConvert, formula, true, false, ExcelMissing.Value, firstCell);
And the exception description is as follows:
Exception Type: System.InvalidCastException
Exception Message: Unable to cast object of type 'ExcelDna.Integration.ExcelError' to type 'System.String'.
I am using Excel 2013 32-bit with Excel-DNA 0.30.

Mar 19, 2014 at 11:03 AM