jsonkenl / xlsxir

Xlsx parser for the Elixir language.
MIT License
215 stars 85 forks source link

Fail to read the formula result #80

Closed junjizhi closed 6 years ago

junjizhi commented 6 years ago

Test file: import-sheet-1.xlsx

iex(36)> path = "./import-sheet-1.xlsx"
iex(37)> [{:ok, s1}|_] = Xlsxir.multi_extract(path)
[
  ok: #Reference<0.1526854273.1649541121.217868>,
  ok: #Reference<0.1526854273.1649541121.217870>
]
iex(38)> Xlsxir.get_list(s1)
[
  [nil, nil, nil],
  [nil, nil,
   "IFERROR(INDEX(INDIRECT(INDIRECT(ADDRESS(3,COLUMN()))&\"[uniqueKey]\"),MATCH(INDIRECT(ADDRESS(ROW(),COLUMN(),1,TRUE,\"object-input\")),INDIRECT(INDIRECT(ADDRESS(3,COLUMN()))&\"[name]\"),0)),IF(ISBLANK(INDIRECT(ADDRESS(ROW(),COLUMN(),1,TRUE,\"object-input\"))), \"\", INDIRECT(ADDRESS(ROW(),COLUMN(),1,TRUE,\"object-input\"))))"]
]

It's expected to return the formula result which should be nil or empty string, but it returns the formula string instead.

jsonkenl commented 6 years ago

Hi @junjizhi, can you please carve out the cells causing the error into a new workbook and share it with me so that I can debug? Please test to make sure the error is reproduced in the new workbook.

junjizhi commented 6 years ago

parse-bug.xlsx

@jsonkenl In the file attached above, there's only one cell A1 in the "Sheet1" that has value. The rest of the workbook is blank. I can reproduce this bug with the above script.