-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Calculate() breaks the resulting value #624
Comments
Hi, please provide more detailed information on how we can recreate this problem. We need either a failing unit test or a workbook together with code that causes the issue. |
Hi, @swmal I encountered similar issue. In my case, I implemented some statistical formulas that However, when I replaced I don't know whether it will be helpful to provide some code samples to reproduce the error because of |
@Vasar007 Did you try to log the errors as described in this section of our wiki? Also, the support for array formulas in EPPlus 4 calc engine is not very good. That is something we will look in to in EPPlus 5. |
@swmal, yeah, I tried. However, no issues were logged:
As you can see, I implemented following functions: Finally, I switched library version to EPPlus 5 but the issue still remains. |
Ok. One known issue is that EPPlus not yet handles array formulas properly. Dont know If that is causing this problem though. Would you mind sharing the code of your custom function that calls FREQENCY/Interop? This is btw functionality that we intend to implement native in EPPlus 5 on our mid term roadmap. |
Sure, you can find all my functions here. |
@swmal I suppose that EPPlus lib cannot properly process returning value of array function. Why else would library call |
I think you will get more interesting output If you do this (typing this from my phone, so excuse if the code is not 100%).
You could be right in that this could have something todo with arrayformulas. EPPlus doesn’t really support them yet. |
@swmal, hmm, I did what you had suggested but I got exactly the same output (except calculation time). However, when I changed returning value from return CreateResult(convertedResult, DataType.Enumerable); to return CreateResult(convertedResult[0], DataType.Decimal); all issues were gone and cell values were calculated (with invalid results, of course). I think that |
EPPlus 4.5.3.3
Code provided:
var cellRange = excelWorksheet.Cells[row, column];
cellRange.Calculate();
cellRange.GetValue();
The cell contains the formula for working days.
After calling the Calculate () method, the Value field cannot be obtained, through Debug its value becomes #VALUE, and when GetValue is called, an exception is thrown.
The text was updated successfully, but these errors were encountered: