SheetChange event crashes using Range.set_value (C#)
Just tried a few tests and it appears that if I don't use the range passed
into my custom function everything is fine.
So it can be reduced to this test case if that helps...
public String TAG(Excel.Range range)
{
String result = "";
try
{
result = "banana apple";
//comment the following line out to make it work
result += range.Value2.ToString();
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show("Bugger2!\n"
+ex.ToString(),"Localization Function");
result = "ERROR!";
}
return result;
}
|