Cannot read property 'cells' of undefined
See original GitHub issueHi ! I just want to try before coding and it’s not working … I have this code :
var Excel = require('exceljs');
var filename = './test.xlsx';
var workbook = new Excel.Workbook();
workbook.xlsx.readFile(filename)
.then(function() {
// use workbook
var worksheet = workbook.getWorksheet('Dataset1');
worksheet.eachRow(function(row, rowNumber) {
console.log('Row ' + rowNumber + ' = ' + JSON.stringify(row.values));
});
});
But I have this error :
Cannot read property ‘cells’ of undefined
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Javascript, Uncaught TypeError: Cannot read property "cells ...
In chrome, I'm seeing the error "Uncaught TypeError: Cannot set property 'innerHTML' of undefined" but have no idea how to fix it. I...
Read more >Cannot read property 'cell' of undefined — DataTables forums
Link to test case: I Try to add new 3 column on the html Debugger code (debug.datatables.net): -- javascript.
Read more >TypeError: Cannot read property 'cell' of undefined · Issue #623
"TypeError: Cannot read property 'cell' of undefined" occurs when a table has variable number of cells in rows and, page breaks inside the...
Read more >Uncaught TypeError: Cannot read property of undefined In
Uncaught TypeError : Cannot read property of undefined error occurs in Chrome when you read a property or call a method on an...
Read more >Uncaught TypeError: Cannot read property 'cells' of undefined
Getting error Uncaught TypeError: Cannot read property 'cells' of undefined When i Click on an item from a RadContextMenu.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hi, @hazemsamoaa .
inboundWorkbook.getWorksheet(1);
This is probably where the problem lies, try to replace id with sheet name. Step intoinboundWorkbook.getWorksheet(1)
and waththis._worksheets
, you’ll find that you have several sheets but no one’s id is 1.i have same issue! but i can solved it
i create new workbook and copy content from old excel file to new workbooks and save it to
.xlsx
i think my issue occur from older version of excel (you can not convert from xls to xlsx by using
save as
or online convert because i tried it! not work). my issue same like #652maybe help!