Community discussion forum

Using the Excel XIRR function in VB.net

  • 4 months ago

    I have created a reference to Excel in my VB code and can access the 'worksheetfunction' where the Xirr function is supposed to be. I know that in Excel it is necessary to add the 'Analysis Toolpak' to the Add-ins before being able to use the XIRR(). Does anyone know how this can be done in VB?

    Post was edited on 08/07/2009 09:17:03 Report abuse
  • 2 months ago

    Hi dude...

    I am not sure if my answer will be useful because I am not good in automation ... however this is what I do and it works perfectly fine with Word, or Excel.

    In Excel start recording a Macro, and perform the operation you are willing to do in your program. After that go to Excel's vb editor, and copy the code.

    Next just past the code into your program, and place excel's object name in front of every command. You might need the value of some constants, for these you will have to get them from Excel... I think you can use F2 and search for the values in the code editor of Excel.

    Hope this helps.

    Best regards.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!