Retrieving the formula string in a cell for open XML C#

Category: open xml format sdk


cecemel on Sat, 26 Nov 2011 17:20:32

Hi all, 

i would like to retrieve formulas as a string from a cell in open XML using SDK 2.0

The cell.CellFormula.Text property doesn't seem to perform the job properly when confronted with a column which always uses the same formula.

When looping trough all the cells of this column,  the first couple of cells provide me the formula whereafter, an empty space is returned. Seemingly the formula is cached, but where?


thank you for helping 

kind regards






Paul23 on Sun, 27 Nov 2011 14:00:00

String data is cached in the SharedStringPart of the workbook. I haven't worked with Excel formulas, but maybe they also use the shared string table in that part?

The best way to explore the document structure is the OpenXML Productivity Tool. You can open the existing document and have it show you the entire document structure as well as code to recreate the document.

cecemel on Sun, 27 Nov 2011 18:38:12

Thank you, it is indeed a start. I will check this further. 


knd regrads, 

steve48 on Thu, 08 Sep 2016 15:05:42

I have similar problem. Not reading all formulas. Did you ever solve it?