ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   XIrr in VBA error (https://www.excelbanter.com/excel-programming/348775-xirr-vba-error.html)

CyberBuzzard

XIrr in VBA error
 
I have setup the reference to ATPVBAEN.XLS in my project, the Add-In is
installed in Excel, I also found the function in the Object Browser under
atpvbaen.xls.VBA Functions and Subs.

Nevertheless I can't make my code work, getting the "Object doesn't support
this property or method" prompt, when writen like this:

rngXIrrCalc = Application.WorksheetFunction.XIrr(rng1, rng2)

I would greatly appreciate if someone can help me with this.

--
Any help will be appreciated.

Regards,

CyberBuzzard

Chip Pearson

XIrr in VBA error
 
I replied to your post an hour ago. What I wrote was....


To call functions in the ATP, once you have set a reference to
the Add-In, simply call them by name, without any prefixing.

rngXIrr = XIrr(...)

If there is a possibility of name collision (e.g., you have a
function with the same name as an ATP function), you can prefix
the function with the library name:

rngXIrr = [atpvbaen.xls].XIrr(...)



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"CyberBuzzard" wrote in message
...
I have setup the reference to ATPVBAEN.XLS in my project, the
Add-In is
installed in Excel, I also found the function in the Object
Browser under
atpvbaen.xls.VBA Functions and Subs.

Nevertheless I can't make my code work, getting the "Object
doesn't support
this property or method" prompt, when writen like this:

rngXIrrCalc =
Application.WorksheetFunction.XIrr(rng1, rng2)

I would greatly appreciate if someone can help me with this.

--
Any help will be appreciated.

Regards,

CyberBuzzard




Ron Rosenfeld

XIrr in VBA error
 
On Thu, 22 Dec 2005 11:36:04 -0800, CyberBuzzard
wrote:

I have setup the reference to ATPVBAEN.XLS in my project, the Add-In is
installed in Excel, I also found the function in the Object Browser under
atpvbaen.xls.VBA Functions and Subs.

Nevertheless I can't make my code work, getting the "Object doesn't support
this property or method" prompt, when writen like this:

rngXIrrCalc = Application.WorksheetFunction.XIrr(rng1, rng2)

I would greatly appreciate if someone can help me with this.


Since you did not find the XIRR function in the WorksheetFunction class, that
means it is not a member of that class. Hence your error message.

After setting the reference as you did, you should be able to use XIRR as you
would any other function.

e.g.:

rngXIrrCalc = XIrr(rng1, rng2)


--ron

CyberBuzzard

XIrr in VBA error
 
Sorry about that, I didn't seem to find my initial post on the list of recent
posts, and I thought I would better post it again lest I may have made a
mistake in the initial process.

Thank you again, Chip
--
Any help will be appreciated.

Regards,

CyberBuzzard


"Chip Pearson" wrote:

I replied to your post an hour ago. What I wrote was....


To call functions in the ATP, once you have set a reference to
the Add-In, simply call them by name, without any prefixing.

rngXIrr = XIrr(...)

If there is a possibility of name collision (e.g., you have a
function with the same name as an ATP function), you can prefix
the function with the library name:

rngXIrr = [atpvbaen.xls].XIrr(...)



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"CyberBuzzard" wrote in message
...
I have setup the reference to ATPVBAEN.XLS in my project, the
Add-In is
installed in Excel, I also found the function in the Object
Browser under
atpvbaen.xls.VBA Functions and Subs.

Nevertheless I can't make my code work, getting the "Object
doesn't support
this property or method" prompt, when writen like this:

rngXIrrCalc =
Application.WorksheetFunction.XIrr(rng1, rng2)

I would greatly appreciate if someone can help me with this.

--
Any help will be appreciated.

Regards,

CyberBuzzard






All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com