question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'cells' of undefined

See original GitHub issue

Hi ! 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:open
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
CJSoldiercommented, Nov 29, 2018

hi, @hazemsamoaa . inboundWorkbook.getWorksheet(1); This is probably where the problem lies, try to replace id with sheet name. Step into inboundWorkbook.getWorksheet(1) and wath this._worksheets, you’ll find that you have several sheets but no one’s id is 1.

0reactions
xang555commented, Nov 25, 2018

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 #652

maybe help!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found