Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95
      Become a Supporter    ::   Make a Contribution   

Re: XIRR in Access 2003

Discussion in 'Information Technology' started by Chris Howard, Oct 27, 2005.

Tags:
  1. Chris Howard

    Chris Howard
    Expand Collapse
    Guest

    Hi Geoff,
    I realize this is an old post. I hope you're still there. Did this work
    for you? Also, I am attempting to create an IRR app myself and it looks like
    you may have some advice...

    "Geoff Seymour" wrote:

    > Hi Tom
    >
    > Many thanks, that should help me finish my application at last!
    >
    > Geoff
    >
    > "Tom Wickerath" wrote:
    >
    > > Hi Geoff,
    > >
    > > This example should get you started in the right direction.
    > >
    > > Tom
    > > ______________________________________
    > >
    > > Option Compare Database
    > > Option Explicit
    > >
    > > Sub XIRRTest()
    > > ' Requires a reference set to the "Microsoft Excel (version) Object Library"
    > > ' Written by Matthias Klaey
    > > ' http://www.mcse.ms/archive153-2004-3-463062.html
    > >
    > > Dim objExcel As Excel.Application
    > > Set objExcel = New Excel.Application
    > >
    > > objExcel.RegisterXLL objExcel.Application.LibraryPath & _
    > > "\ANALYSIS\ANALYS32.XLL"
    > >
    > > Dim p(4) As Double
    > > p(0) = -10000
    > > p(1) = 2750
    > > p(2) = 4250
    > > p(3) = 3250
    > > p(4) = 2750
    > >
    > > Dim d(4) As Date
    > > d(0) = #1/1/1998#
    > > d(1) = #3/1/1998#
    > > d(2) = #10/30/1998#
    > > d(3) = #2/15/1999#
    > > d(4) = #4/1/1999#
    > >
    > > Debug.Print objExcel.Run("XIrr", p, d) ' Result: 0.374858599901199
    > >
    > > objExcel.Quit
    > >
    > > Set objExcel = Nothing
    > >
    > >
    > > End Sub
    > >
    > > ______________________________________
    > >
    > > "Geoff Seymour" <Geoff Seymour@discussions.microsoft.com> wrote in message
    > > news:3C208625-20FC-4E03-9A55-98FD623AEF27@microsoft.com...
    > >
    > > I would appreciate it if anyone can let me know how to calculate the XIRR
    > > function in Access 2003.
    > >
    > >
    > >
     
  2. Loading...


  3. Geoff Seymour

    Geoff Seymour
    Expand Collapse
    Guest

    Hi Chris

    Yes, this was great advice from Tom and it worked. My application was
    successfully completed and has been running since 2004. The important thing
    to do is to set the gobj Excel only once for all your calls and to quit after
    their completion. This will result in the fastest possible response time.
    If you do the set and quit for each call to Excel your response time will
    probably be totally unacceptable - of course it depends on how many calls you
    make.

    Feel free to email if you have further queeries

    Geoff



    "Chris Howard" wrote:

    > Hi Geoff,
    > I realize this is an old post. I hope you're still there. Did this work
    > for you? Also, I am attempting to create an IRR app myself and it looks like
    > you may have some advice...
    >
    > "Geoff Seymour" wrote:
    >
    > > Hi Tom
    > >
    > > Many thanks, that should help me finish my application at last!
    > >
    > > Geoff
    > >
    > > "Tom Wickerath" wrote:
    > >
    > > > Hi Geoff,
    > > >
    > > > This example should get you started in the right direction.
    > > >
    > > > Tom
    > > > ______________________________________
    > > >
    > > > Option Compare Database
    > > > Option Explicit
    > > >
    > > > Sub XIRRTest()
    > > > ' Requires a reference set to the "Microsoft Excel (version) Object Library"
    > > > ' Written by Matthias Klaey
    > > > ' http://www.mcse.ms/archive153-2004-3-463062.html
    > > >
    > > > Dim objExcel As Excel.Application
    > > > Set objExcel = New Excel.Application
    > > >
    > > > objExcel.RegisterXLL objExcel.Application.LibraryPath & _
    > > > "\ANALYSIS\ANALYS32.XLL"
    > > >
    > > > Dim p(4) As Double
    > > > p(0) = -10000
    > > > p(1) = 2750
    > > > p(2) = 4250
    > > > p(3) = 3250
    > > > p(4) = 2750
    > > >
    > > > Dim d(4) As Date
    > > > d(0) = #1/1/1998#
    > > > d(1) = #3/1/1998#
    > > > d(2) = #10/30/1998#
    > > > d(3) = #2/15/1999#
    > > > d(4) = #4/1/1999#
    > > >
    > > > Debug.Print objExcel.Run("XIrr", p, d) ' Result: 0.374858599901199
    > > >
    > > > objExcel.Quit
    > > >
    > > > Set objExcel = Nothing
    > > >
    > > >
    > > > End Sub
    > > >
    > > > ______________________________________
    > > >
    > > > "Geoff Seymour" <Geoff Seymour@discussions.microsoft.com> wrote in message
    > > > news:3C208625-20FC-4E03-9A55-98FD623AEF27@microsoft.com...
    > > >
    > > > I would appreciate it if anyone can let me know how to calculate the XIRR
    > > > function in Access 2003.
    > > >
    > > >
    > > >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page