I've uploaded ExcelDna version 0.11 to http://exceldna.typepad.com/blog/files/ExcelDna-0.11.zip.
This version should fix the mysterious loading errors reported since version 0.8. The problem was related to Visual Studio 2005 Service Pack 1, which has a new version of the C runtime libraries. The
embedded manifest in recent versions of ExcelDna.xll required the new version of the CRT to be loaded with ExcelDna. I have now changed the manifest that is embedded to require the RTM version as before.
Please let me know if you still have errors loading ExcelDna with this version, also on Excel 2007.
Other significant features and fixes since version 0.7:
* Fixed bug when library had function with object[] and object[,] arguments.
* Fixed bug when more that 20 arguments. (At most 20 argument descriptions are allowed.)
* Methods can be dynamically registered in the AutoOpen method of an AddIn.
ExcelDna.Integration.XlLibrary.RegisterMethods(..) takes a list of MethodInfos to register. See sample08.dna for an example.
* Arguments of type object[] and double[] now also accept single column values. If the range passed in has exactly one column, that column is used as the array. If more than one column is passed, the first row is used, as before. object[,] and double[,] have not changed.
As always, your feedback is much appreciated. Please post your comments or questions at the ExcelDna Google Group.
I am using the latest ExcelDNA version 0.11 and I am noticing in C# that the order of the arguments makes a difference.
The following two functions do exactly the same thing. In the second function i have moved the string argument to the end. The first function causes ExcelDNA to crash, whereas the second function works fine.
Is this a bug or does the order of the arguments really matter? i.e can't start with a string as a declaration argument.
public static double GBlackScholes1(string CallPutFlag, double S, double X, double T, double r, double b, double v)
{
double d1;
double d2;
d1 = (Math.Log(S / X) + (b + v * v / 2) * T) / (v * Math.Sqrt(T));
d2 = d1 - v * Math.Sqrt(T);
if (CallPutFlag == "C")
{
return S * Math.Exp((b - r) * T) * N_Csharp(d1) - X * Math.Exp(-r * T) * N_Csharp(d2);
}
else if (CallPutFlag == "P")
{
return X * Math.Exp(-r * T) * N_Csharp(-d2) - S * Math.Exp((b - r) * T) * N_Csharp(-d1);
}
return 0;
} //end of GBlackScholes1
public static double GBlackScholes2(double S, double X, double T, double r, double b, double v,string CallPutFlag)
{
double d1;
double d2;
d1 = (Math.Log(S / X) + (b + v * v / 2) * T) / (v * Math.Sqrt(T));
d2 = d1 - v * Math.Sqrt(T);
if (CallPutFlag == "C")
{
return S * Math.Exp((b - r) * T) * N_Csharp(d1) - X * Math.Exp(-r * T) * N_Csharp(d2);
}
else if (CallPutFlag == "P")
{
return X * Math.Exp(-r * T) * N_Csharp(-d2) - S * Math.Exp((b - r) * T) * N_Csharp(-d1);
}
return 0;
} //end of GBlackScholes2
public static double N_Csharp(double z) //Cumulative Density
{
if (z > 6.0) { return 1.0; } //to prevent overflow
if (z = 0.0)
{
return 1.0 - n1_Csharp(z) * (a1 * k + (a2 * k * k) + (a3 * k * k * k));
}
else
{
return 1.0 - N_Csharp(-z);
}
} // end of N_Csharp(z)
Posted by: H | 07 April 2007 at 06:51
Hi,
I have a problem, I don“t know to use this product when i use functions which return arrays.
For example :
public static double[] SortVector(double[] vector)
{
Array.Sort(vector);
return vector;
}
Can somebody tell me how i have to mark the cells in the excel sheet.
Posted by: Juan | 18 July 2007 at 09:43
Hi!
could you please give an update on the development status? In particular, what is the progress with reusing in Excel C#/VB objects defined in .net?
tnx
Posted by: S | 08 January 2008 at 16:04
Any updates?
Posted by: Registry Remedies | 25 January 2008 at 18:50
Version 0.11 is still the latest version. The Google group (http://groups.google.com/group/exceldna) is now the best place to keep track of the project. Anything in particular you'd like?
Posted by: govert | 26 January 2008 at 09:10
Hi
I wrote a method that return Unicode String and its not work correctly.
It is return question mark (????? ??? ???? ).
How can I solve this problem?
This function is work correctly in other application.
Thanks
Posted by: Ahmad Moghadasi | 01 March 2008 at 10:01