Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF for Excel in C# paramters not coming through
Hello,
I'm trying to get a UDF written in C# to work. Thanks to the excellent article from Eric Carter you'll get a flying start. "user defined functions for Excel in .NET" http://blogs.msdn.com/eric_carter/ar...01/273127.aspx But when I use the function in Excel as described I get the known #VALUE! result ;o( When I debug I see that the parameters from Excel are not coming through, they remain null. When I add a function without parameters, I get result. It gets more strange because the breakpoints do not work "anymore" on function MultiplyNTimes, the worked at least once ;o) On every other function I add I can create breakpoints but still no parameters coming through ;o) f.i.: public double Add(object Number1, object Number2) { double result = 0; Excel.Range r1 = Number1 as Excel.Range; Excel.Range r2 = Number2 as Excel.Range; result = Convert.ToDouble(r1.Value2) + Convert.ToDouble(r1.Value2); return result; } I'm just starting to play with c#, any clues highly appreciated! Thx! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Paramters or Arugment Auto-Label for User-Defined Function | Excel Worksheet Functions | |||
Database query with a range of cells as paramters? | Excel Discussion (Misc queries) | |||
Excel Spreadsheet should be 5 pgs., coming out 10 pgs. | Excel Discussion (Misc queries) | |||
how do I add paramters / criteria in the excel query? | Excel Programming | |||
Parsing paramters | Excel Programming |