Hello
I have an Excel file which I load into an Infragistics.Excel.Workbook object. In this Excel file, I have a cell where I put a value, and another one which calculates something from the first one. In my code, I want to retrieve the resulting value from this second cell, but all I can get is the formula itself.How do I tell the Infragistics.Excel engine to give me the value, not the formula?ThanksGuy
I'm trying to reproduce the problem in a sample project but it seems to work fine. The first time I get the cell value there is a lag, then all is running smoothly.I'm trying to figure out why in my real project I have that issue and perhaps I'll ask for further support.Thanks
Would it be possible to attach a small sample reproducing this?
If I don't use Recalculate() there are absolutely multiple lags, not just one. Every time I ask for a cell value in my loop, it seems to recalculate all workbook formulas.
Well that seems to support my theory about what is causing the lag. Recalculate will explicitly force the calculation of all formulas whereas getting the first calculated value just does it lazily.
It makes sense that the lag would return when the Recalculate call is removed. But I am curious: is there one lag and then everything is fine after that, or are you experiencing multiple lags? If it is only one, then there is really nothing you can do other than submit a performance bug so that we can look into possibly reducing the lag. And the only thing you could do in code in that case is choose whether you want to control when the lag occurs (with a Recalculate call) or you want to let it happen when it needs to happen. But if there are multiple lags, there may be a bug.
Hi Mike,
I tried to insert wokrbook.Recalculate() before looping throught the cell values. It takes 5 sec to calculate all formulas and then I'm able to get the cell values instantly.
If I remove Recalculate(), the lag problem returns. Any idea?