Can not read excel file
alfredalfie123 opened this issue · comments
When I try to read my excel file, I got this error below:
TypeError: Cannot read property 'autoFilterRef' of null
at TableXform.parseClose (/home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xform/table/table-xform.js:99:62)
at SAXStream.<anonymous> (/home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xform/base-xform.js:83:21)
at SAXStream.emit (events.js:209:13)
at SAXStream.EventEmitter.emit (domain.js:476:20)
at SAXParser.me._parser.<computed> [as onclosetag] (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:258:17)
at emit (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:624:35)
at emitNode (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:629:5)
at closeTag (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:889:7)
at SAXParser.write (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:1436:13)
at SAXStream.write (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:239:18)
at /home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:206:14
at new Promise (<anonymous>)
at write (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:205:14)
at Array.map (<anonymous>)
at StreamBuf._pipe (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:211:34)
at StreamBuf._flush (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:275:14)
at writeComplete (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:288:14)
at StreamBuf.end (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:298:7)
at StreamBuf.pipe (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:346:12)
at TableXform.parseStream (/home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xform/base-xform.js:102:12)
at XLSX._processTableEntry (/home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xlsx.js:153:31)
at /home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xlsx.js:320:30
Can someone help me?
Same here ... comeonce can help?
I have this problem when the autoFilter
child of table
is missing like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="1" name="Table1" displayName="Table1" ref="A1:K335" totalsRowShown="0"><tableColumns count="11"><tableColumn id="1" name="key"/><tableColumn id="2" name="data1"/><tableColumn id="3" name="data2"/><tableColumn id="4" name="data3"/><tableColumn id="5" name="data4"/><tableColumn id="6" name="data5"/><tableColumn id="7" name="data6"/><tableColumn id="8" name="data7"/><tableColumn id="9" name="data8"/><tableColumn id="10" name="data9"/><tableColumn id="11" name="data10"/></tableColumns><tableStyleInfo name="TableStyleLight9" showFirstColumn="0" showLastColumn="0" showRowStripes="0" showColumnStripes="0"/></table>
If I filter the table in excel and resave, the file is readable:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="1" name="Table1" displayName="Table1" ref="A1:K335" totalsRowShown="0"><autoFilter ref="A1:K335"/><tableColumns count="11"><tableColumn id="1" name="key"/><tableColumn id="2" name="data1"/><tableColumn id="3" name="data2"/><tableColumn id="4" name="data3"/><tableColumn id="5" name="data4"/><tableColumn id="6" name="data5"/><tableColumn id="7" name="data6"/><tableColumn id="8" name="data7"/><tableColumn id="9" name="data8"/><tableColumn id="10" name="data9"/><tableColumn id="11" name="data10"/></tableColumns><tableStyleInfo name="TableStyleLight9" showFirstColumn="0" showLastColumn="0" showRowStripes="0" showColumnStripes="0"/></table>