View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Steve Kirk (Insomniac Games) Steve Kirk (Insomniac Games) is offline
external usenet poster
 
Posts: 4
Default 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;
}