What would be the Syntax and Namespace to call IRR

  • Thread starter Thread starter Burton Wilkins
  • Start date Start date
B

Burton Wilkins

What would be the syntax and namespace to be able to call
the VB function IRR?
 
Burton,
Reference the Microsoft.VisualBasic.dll.

The IRR function is in the Microsoft.VisualBasic.Financial class. Remember
that Modules in VB.NET are simply classes to C# with only static members.

Something like:

double[] valueArray = { -70000, 22000, 25000, 28000, 31000 };
double irr, guess = 0.1;

irr = Microsoft.VisualBasic.Financial.IRR(ref valueArray, guess);

Debug.WriteLine(irr.ToString("P"), "irr");

I'm really not sure why they defined the valueArray to be ref, I suspect
they translated the function literally from VB6. Rather then the intent of
the function.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top