Bharaniminfy

Hi Experts,

I need to actually calculate XIRR in my application. This fuction is actually available in Excel.

is there a way to do leverage the method from C# code. currectly i have created an excel object in my C# code.




Re: Visual Studio Tools for Office Using Excel funtion from C#

Figo Fei - MSFT

Hi,

I'm not Excel expert, can you explain what XIRR is to us

Will Excel automation meet your needs:

How to automate Microsoft Excel from Microsoft Visual C# .NET

Edit: I moved it to VSTO forum for better help.

Thanks






Re: Visual Studio Tools for Office Using Excel funtion from C#

Geoff Darst - MSFT

Hi,

This forum is actually intended for questions relating to Visual Studio Tools For Office. Excel programming questions would best be handled in the Excel Programming newsgroup: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.excel.programming&lang=en&cr=US

However, the answer to your question is that all Excel built-in worksheet functions can be accessed via the WorksheetFunction accessor. So to call XIRR, you would do something like this:

Application.WorksheetFunction.Xirr(...);

Sincerely,

Geoff Darst

Microsoft VSTO Team