This project is read-only.
1
Vote

Table1[Data1] can be resolved?

description

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.
I can confirm the range of Table1 in Excel: =Sheet1!$A$2:$C$4

Any good workaround?

comments