I have a class that reads & writes Excel (xlsx) cells using OpenXML SDK. The class is based of the most voted answer from here: Open XML SDK 2.0 - how to update a cell in a spreadsheet?
I need to update a cell and then get a value of another cell, which contains a calculation formula. The update works fine, but when I read the formula cell after the update I get the old value, that existed in the doc before editing. However, when I open my xlsx manually after running the program I can see the correct value.
So it's seems like the old value for cell is cached somewhere... Which is weird, because I open/close my doc each time before I read/write cells.
EDIT: Vincent's answer made me update my sample code. I added a Refresh method that opens, saves and closes the document in the Excel application ran in background. This recalculates my formulas. For more details and C# code sample see: http://fczaja.blogspot.com/2013/05/how-to-read-and-write-excel-cells-with.html