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.

Unable to read excel file with latest excel js. File Not Found.

See original GitHub issue

Unable to read excel file with latest excel js. File is not found. Getting the following error while trying to read excel files. I have double checked. The relative path provided is correct.

Unhandled rejection Error: File not found: ../TestData/TestData.xlsx
    at C:\Users\xxx\Documents\Eclipse\CSS_Sample\node_modules\exceljs\lib\xlsx\xlsx.js:60:17
    at tryCatcher (C:\Users\xxx\Documents\Eclipse\CSS_Sample\node_modules\exceljs\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\xxx\Documents\Eclipse\CSS_Sample\node_modules\exceljs\node_modules\bluebird\js\release\promise.js:503:31)
    at Promise._settlePromise (C:\Users\xxx\Documents\Eclipse\CSS_Sample\node_modules\exceljs\node_modules\bluebird\js\release\promise.js:560:18)
    at Promise._settlePromise0 (C:\Users\xxx\Documents\Eclipse\CSS_Sample\node_modules\exceljs\node_modules\bluebird\js\release\promise.js:605:10)
    at Promise._settlePromises (C:\Users\xxx\Documents\Eclipse\CSS_Sample\node_modules\exceljs\node_modules\bluebird\js\release\promise.js:684:18)
    at Async._drainQueue (C:\Users\xxx\Documents\Eclipse\CSS_Sample\node_modules\exceljs\node_modules\bluebird\js\release\async.js:126:16)
    at Async._drainQueues (C:\Users\xxx\Documents\Eclipse\CSS_Sample\node_modules\exceljs\node_modules\bluebird\js\release\async.js:136:10)
    at Immediate.Async.drainQueues [as _onImmediate](C:UsersxxxDocumentsEclipseCSS_Samplenode_modulesexceljsnode_modulesbluebirdjsreleaseasync.js:16:14)
    at processImmediate [as _immediateCallback](timers.js:383:17)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
luiijoquirozcommented, Sep 17, 2019

I have solved the problem as follows. `const exceljs = require(‘exceljs’); const fs = require(‘fs’); const path = ‘path/archive.xlsx’; const excel = fs.realpathSync(path,{encoding:‘utf8’});

const wb = new exceljs.Workbook;

wb.xlsx.readFile(excel).then(function(){

//your code here

}).catch(error => { console.error(‘Algo salio mal’, error); });`

1reaction
hassanQureshi22commented, Sep 17, 2019

I solved it give the whole path of the file

Read more comments on GitHub >

github_iconTop Results From Across the Web

Files do not open in Excel or "File Not Found" occurs when ...
Start the Microsoft Windows Explorer. · On the Tools menu, click Folder Options. · Click the File Types tab. · Click the file...
Read more >
Reading Excel through exceljs module - Stack Overflow
My Question is How to provide relative path of excel file in readFile() . I want to provide path for Data. xls in...
Read more >
[Solved] Excel Cannot Open the File Because the Extension Is ...
Summary: This post discusses workarounds to resolve the 'Excel cannot open the file because the extension is not valid' error.
Read more >
[FIXED] Excel Cannot Open the File Because The Extension Is ...
The Excel file is not compatible with the version of MS Excel you're using. 4. Why can't I open an XLSX file? When...
Read more >
Get rid of "The file is corrupt and cannot be opened" in Excel
How to open a corrupt xls. file in Excel 2010 - 365 · Open Excel. · Click on File -> Options. · Select...
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