XIrr in VBA error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
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 said:
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 said:
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
 

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

Similar Threads


Back
Top