Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Created Unassigned: Table1[Data1] can be resolved? [14014]

$
0
0
Hi.

Sheet sample:
```
|Data1|Data2|Data3|
|-----|-----|-----|
| 1| 2| 3|
| 4| 5| 6|
| 7| 8| 9|
```

Name Data1 is represented as __Table1[Data1]__. I can get actual cell range __=Sheet1!$A$2:$A$4__ if I delete and convert the table to ranges.


C# problem code:
```
XSSFWorkbook workbook = new XSSFWorkbook(fs);
var name = workbook.GetName("Data1");
var cells = new AreaReference(name.RefersToFormula);
```

AreaReference throws FormatException.

Another approach? I have tried ILSpy. Here is another one:
```
XSSFWorkbook workbook = new XSSFWorkbook(fs);
XSSFEvaluationWorkbook ev = XSSFEvaluationWorkbook.Create(workbook);
var name = workbook.GetName("Data1");
var ptgs = FormulaParser.Parse(name.RefersToFormula, ev);
```

Result:
* FormulaParseException: Specified named range 'Table1' does not exist in the current workbook.

Any good workaround?

Viewing all articles
Browse latest Browse all 1621

Trending Articles



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