Hi Govert,
Apologies for the delayed reply. I've taken your example and stripped
it down even further, but have retained the parameters of my original
UDF and the UDF name:
<DnaLibrary Language="C#">
<Reference AssemblyPath="System.Windows.Forms.dll"/>
<![CDATA[
using System;
using System.Windows.Forms;
using ExcelDna.Integration;
public class MyFunctions
{
/// <summary>
/// Binning
/// </summary>
[ExcelFunction( IsExceptionSafe = true , IsHidden = false ,
IsMacroType = false , IsThreadSafe = true , IsVolatile = true , Name =
"BinEqualFrequency" )]
public static object BinEqualFrequency(
[ExcelArgument( AllowReference = true , Name =
"ValuesToBin" )] object valuesToBin ,
[ExcelArgument( AllowReference = false , Name =
"FirstBin" )] object firstBin ,
[ExcelArgument( AllowReference = false , Name =
"TotalBins" )] object totalBins )
{
object rangeValues =
( ( ExcelReference )valuesToBin ).GetValue();
return "Good";
} // BinEqualFrequency()
}
]]>
</DnaLibrary>
In this very simple case (I didn't test IsMacroType=true because I
would never set that), I can get Excel to crash on a test spreadsheet
generated on using my fully functional UDF (I'll email you the
spreadsheet)
BTW, the repro steps are bizarre:
1. Open Excel, install the add-in, close excel
2. Open Excel, ensure the add-in was installed (I've found that Excel
sometimes doesn't install the add-in - particularly when you had
another add-in by the same name). Close excel
3. double-click spreadsheet to open. delete column L. crash.
here's the bizarre part:
4. launch excel. excel crashes again (its trying to recover the
spreadsheet that caused the crash). "close program"
5. launch excel again. see spreadsheet with bunch of #N/A errors.
close Excel without saving.
6. double-click spreadsheet to open. delete column L. NO CRASH
7. from here, I can't determine the pattern, but some combination of
closing and opening excel without the spreadsheet, then opening the
spreadsheet will bring you back to step #3 above. rise, repeat. =)
so I guess the first task is to see if you can repro the above?
-Suraj
> > > > > > > > dependency chain of my UDF, my UDF crashes when calling...