Excel Automation from C# (2005): COUPDAYBS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stocki

    Excel Automation from C# (2005): COUPDAYBS

    Hi,

    I've written a small piece of code to pass a formula to Excel 2003,
    start a calculation, receive the value back und show it in my C#
    (.Net2005) WinForm. Works fine so far.

    The other day I wanted to pass the following formula to my app:
    "COUPDAYBS( DATE(2007;1;25) ; DATE(2008;11;15 ); 2; 1 )". This is not
    working. I always receive a number like "-2146826259", which in fact
    is wrong. The correct result would be 71.

    Tried this in Excel itself and discovered that I need to switch on the
    "Analyse-Funktionen" AddIn from Extras|Add-Ins (first add in in the
    list).

    How can I switch it on from within C#.

    Any hint is highly appreciated!

    Cheers

    Andreas
Working...