+ Reply to Thread
Results 1 to 12 of 12

XIRR in VBA?

  1. #1
    Don Wiss
    Guest

    XIRR in VBA?

    Hi,

    I see that XIRR is not a WorksheetFunction in VBA. I gather this is because
    it comes from the Analysis ToolPak. I have never checked for my Add-Ins
    Analysis ToolPak - VBA. So I just did. Still XIRR doesn't seem to be
    available. How do I use it in VBA?

    Just what does the Analysis ToolPak - VBA add-in give me?

    Don <donwiss at panix.com>.

  2. #2
    Don
    Guest

    Re: XIRR in VBA?

    Don

    This will work, however you have to reference ATPVBAEN.XLA. Select
    ATPVBAEN.XLA from the references dialog Box. (i.e.Tools\References)

    Yield = xirr(MYarray, MYdates, 0.08)


    Don

    "Don Wiss" <donwiss@no_spam.com> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I see that XIRR is not a WorksheetFunction in VBA. I gather this is
    > because
    > it comes from the Analysis ToolPak. I have never checked for my Add-Ins
    > Analysis ToolPak - VBA. So I just did. Still XIRR doesn't seem to be
    > available. How do I use it in VBA?
    >
    > Just what does the Analysis ToolPak - VBA add-in give me?
    >
    > Don <donwiss at panix.com>.




  3. #3
    Myrna Larson
    Guest

    Re: XIRR in VBA?

    In the VB Editor, go to Tools/References, and be sure there's a check mark in
    front of ATPVBAEN.XLS (the name may differ slightly.. the EN means English).
    Then you just write a line like

    X = XIRR(.....)


    On Sat, 19 Feb 2005 22:20:29 -0500, Don Wiss <donwiss@no_spam.com> wrote:

    >Hi,
    >
    >I see that XIRR is not a WorksheetFunction in VBA. I gather this is because
    >it comes from the Analysis ToolPak. I have never checked for my Add-Ins
    >Analysis ToolPak - VBA. So I just did. Still XIRR doesn't seem to be
    >available. How do I use it in VBA?
    >
    >Just what does the Analysis ToolPak - VBA add-in give me?
    >
    >Don <donwiss at panix.com>.



  4. #4
    Myrna Larson
    Guest

    Re: XIRR in VBA?

    PS: At Tools/AddIns, you should check both Analysis ToolPak and Analysis
    ToolPak-VBA. What does it give you? The ability to do what you have been
    trying to do and can't, i.e. use the functions in the ATP from your VBA code.

    Don't forget the Tools/References step in the VB Editor.

    On Sat, 19 Feb 2005 22:20:29 -0500, Don Wiss <donwiss@no_spam.com> wrote:

    >Hi,
    >
    >I see that XIRR is not a WorksheetFunction in VBA. I gather this is because
    >it comes from the Analysis ToolPak. I have never checked for my Add-Ins
    >Analysis ToolPak - VBA. So I just did. Still XIRR doesn't seem to be
    >available. How do I use it in VBA?
    >
    >Just what does the Analysis ToolPak - VBA add-in give me?
    >
    >Don <donwiss at panix.com>.



  5. #5
    Don Wiss
    Guest

    Re: XIRR in VBA?

    On 19 Feb 2005, Myrna Larson <[email protected]> wrote:

    >On Sat, 19 Feb 2005 22:20:29 -0500, Don Wiss <donwiss@no_spam.com> wrote:
    >
    >>I see that XIRR is not a WorksheetFunction in VBA. I gather this is because
    >>it comes from the Analysis ToolPak. I have never checked for my Add-Ins
    >>Analysis ToolPak - VBA. So I just did. Still XIRR doesn't seem to be
    >>available. How do I use it in VBA?
    >>
    >>Just what does the Analysis ToolPak - VBA add-in give me?


    >PS: At Tools/AddIns, you should check both Analysis ToolPak and Analysis
    >ToolPak-VBA. What does it give you? The ability to do what you have been
    >trying to do and can't, i.e. use the functions in the ATP from your VBA code.
    >
    >Don't forget the Tools/References step in the VB Editor.


    Okay. I did all this. It was fine with my workbook. But then when someone
    else opened the workbook they got an Excel Catastrophic Error. I can have
    the Workbook_Open macro turn on the Analysis ToolPak - VBA. Do I also have
    to do something to set the references on my user machines? This workbook
    will be widely distributed.

    Don <donwiss at panix.com>.

  6. #6
    Myrna Larson
    Guest

    Re: XIRR in VBA?

    In the object browser, search for AddFromFile. This method allows you to add a
    reference to another library at run-time. The problem is, this routine is part
    of the VB-IDE Extensibility library, which I would expect is less likely to be
    present on your user's machines than is the ATP.

    I'm sure there is a solution to this, but I don't remember what it is. Try
    searching Google. Or maybe somebody else will step in with some suggestions.
    Maybe you will need to use an installation routine.

    BTW, if the only function you need from the ATP is XIRR, I have written my own
    version, which gives the same results and runs quite a bit faster.


    On Tue, 22 Feb 2005 19:35:09 -0500, Don Wiss <donwiss@no_spam.com> wrote:

    >On 19 Feb 2005, Myrna Larson <[email protected]> wrote:
    >
    >>On Sat, 19 Feb 2005 22:20:29 -0500, Don Wiss <donwiss@no_spam.com> wrote:
    >>
    >>>I see that XIRR is not a WorksheetFunction in VBA. I gather this is because
    >>>it comes from the Analysis ToolPak. I have never checked for my Add-Ins
    >>>Analysis ToolPak - VBA. So I just did. Still XIRR doesn't seem to be
    >>>available. How do I use it in VBA?
    >>>
    >>>Just what does the Analysis ToolPak - VBA add-in give me?

    >
    >>PS: At Tools/AddIns, you should check both Analysis ToolPak and Analysis
    >>ToolPak-VBA. What does it give you? The ability to do what you have been
    >>trying to do and can't, i.e. use the functions in the ATP from your VBA

    code.
    >>
    >>Don't forget the Tools/References step in the VB Editor.

    >
    >Okay. I did all this. It was fine with my workbook. But then when someone
    >else opened the workbook they got an Excel Catastrophic Error. I can have
    >the Workbook_Open macro turn on the Analysis ToolPak - VBA. Do I also have
    >to do something to set the references on my user machines? This workbook
    >will be widely distributed.
    >
    >Don <donwiss at panix.com>.



  7. #7
    Don Wiss
    Guest

    Re: XIRR in VBA?

    On 22 Feb 2005, Myrna Larson <[email protected]> wrote:

    >In the object browser,


    Object Browser?

    >search for AddFromFile. This method allows you to add a
    >reference to another library at run-time. The problem is, this routine is part
    >of the VB-IDE Extensibility library, which I would expect is less likely to be
    >present on your user's machines than is the ATP.


    I turn on the regular Analysis ToolPak in many of my programs, including
    this one. No machine will have Analysis ToolPak - VBA turned on.

    >BTW, if the only function you need from the ATP is XIRR, I have written my own
    >version, which gives the same results and runs quite a bit faster.


    Yes, this is the only function I need. Having a reference to a library does
    seem like overkill. Contact me privately and I can see what I have I can
    send in return.

    Don <donwiss at panix.com>.

  8. #8
    Myrna Larson
    Guest

    Re: XIRR in VBA?

    I have emailed you a workbook with the code and some demo data.

    On Tue, 22 Feb 2005 22:07:07 -0500, Don Wiss <donwiss@no_spam.com> wrote:

    >On 22 Feb 2005, Myrna Larson <[email protected]> wrote:
    >
    >>In the object browser,

    >
    >Object Browser?
    >
    >>search for AddFromFile. This method allows you to add a
    >>reference to another library at run-time. The problem is, this routine is

    part
    >>of the VB-IDE Extensibility library, which I would expect is less likely to

    be
    >>present on your user's machines than is the ATP.

    >
    >I turn on the regular Analysis ToolPak in many of my programs, including
    >this one. No machine will have Analysis ToolPak - VBA turned on.
    >
    >>BTW, if the only function you need from the ATP is XIRR, I have written my

    own
    >>version, which gives the same results and runs quite a bit faster.

    >
    >Yes, this is the only function I need. Having a reference to a library does
    >seem like overkill. Contact me privately and I can see what I have I can
    >send in return.
    >
    >Don <donwiss at panix.com>.



  9. #9
    Don Wiss
    Guest

    Re: XIRR in VBA?

    On 22 Feb 2005, Myrna Larson <[email protected]> wrote:

    >I have emailed you a workbook with the code and some demo data.


    Thanks, but I didn't receive it. Be sure to change my e-mail address to the
    one below.

    Don <donwiss at panix.com>.

  10. #10
    Myrna Larson
    Guest

    Re: XIRR in VBA?

    That's where I sent it (panix) at about 10:05 PM last night, Central time. If
    you still haven't gotten it, you can email me at myrna larson at charter dot
    net, without the quotes and spaces and with the obvious substitutions.


    On Wed, 23 Feb 2005 05:48:28 -0500, Don Wiss <donwiss@no_spam.com> wrote:

    >On 22 Feb 2005, Myrna Larson <[email protected]> wrote:
    >
    >>I have emailed you a workbook with the code and some demo data.

    >
    >Thanks, but I didn't receive it. Be sure to change my e-mail address to the
    >one below.
    >
    >Don <donwiss at panix.com>.



  11. #11
    Registered User
    Join Date
    01-10-2011
    Location
    New york
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: XIRR in VBA?

    Quote Originally Posted by Myrna Larson View Post
    That's where I sent it (panix) at about 10:05 PM last night, Central time. If
    you still haven't gotten it, you can email me at myrna larson at charter dot
    net, without the quotes and spaces and with the obvious substitutions.


    On Wed, 23 Feb 2005 05:48:28 -0500, Don Wiss <donwiss@no_spam.com> wrote:

    >On 22 Feb 2005, Myrna Larson <[email protected]> wrote:
    >
    >>I have emailed you a workbook with the code and some demo data.

    >
    >Thanks, but I didn't receive it. Be sure to change my e-mail address to the
    >one below.
    >
    >Don <donwiss at panix.com>.
    Hello Myrna ,

    Can you please send me that workbook also on dklibran at aol.com. I am also doing research on it.

    Thanks and much appreciated

    Darpan

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: XIRR in VBA?

    Welcome to the forum, DKBA.

    This is a 5-year old post; Myrna may not be stopping by regularly to check it.

    Please take a few minutes to read the forum rules, and then start your own thread.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1