Quantcast
Channel: ClosedXML - The easy way to OpenXML
Viewing all articles
Browse latest Browse all 1877

Edited Unassigned: When trying to retrieve value of a formula, ClosedXML throws 'Identifier Expected' Exception [9419]

$
0
0
I am using ClosedXML 0.76.0 to build my application, which handles Excel files.

At one moment, I populate an Excel file with formulas. So far, so good.

The user then gets this file and fills in values concerning the business.

At this moment, I read calculated values and populate another larger Excel file.

The problem is that when I try reading cells with fomulas, ClosedXML throws "Identifier Expected" exception.

My code is just as follows:

```
1 string formula = row.Cell(i).FormulaA1;

2 object result = workbook.Evaluate(formula);

3 sum += Convert.ToDecimal(result, CultureInfo.InvariantCulture);

```
The exception happens on line 2.

The formula is likely to be _'Indice'!D$5*'URCTS - 210'!G5_ or similar. There are single quotes delimiting worksheet names containing spaces.

Viewing all articles
Browse latest Browse all 1877

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>