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
.



Relevant Pages

  • Re: Disabling Autocalculation when opening CSV files
    ... For Each osht In ActiveWorkbook ... I am not very technical in Excel myself but I would like to add that: ... The calculation mode is always set to Manual (without recalculation ... Switch to Manual calculation and turn off Recalculate before save. ...
    (microsoft.public.excel.programming)
  • Re: delay on copy
    ... if you have a lot of formulas in the worksheet, excel might be doing a ... calculation) and seeing if that speeds it up (don't forget to switch ... calculation back to automatic as it affects all the workbooks that you open) ...
    (microsoft.public.excel)
  • Re: Getting around Dependency Tree Performance Problems
    ... That does not work there is no proper dependency on the Range... ... The Excel Calculation Site ... cell range on my system from 65 seconds to 2 seconds. ...
    (microsoft.public.excel.programming)
  • RE: Cannot get code to work for API Save Dialog Box
    ... Then you could include it in your query and export it to Excel ... to use the default value property of the new text box to do the calculation. ... I checked the cells in the spreadsheet created and the cells are blank. ... cells where you expect the formula to calculate the totals. ...
    (microsoft.public.access.forms)
  • Re: Form Protection with Excel Object Embedded
    ... the best field to base the calculation on might be the one in the example titled 'Calculate the # Days Difference ... The date input format is of no consequence, provided both dates have a day, month and year- you might want to enforce this via the ... Excel workbook, though. ... At most, you'll need to insert a paragraph break immediately before the workbook, then format the workbook ...
    (microsoft.public.word.application.errors)