I am trying to read a excel file but I am getting Invalid HTML: could not find <table> issue

See original GitHub issue

Hi All,

I am reading an excel file using below code

if (event.fromElement.files.length==0) {
            return(false);   // leave in case no file was chosen
        };
        alasql('SELECT * FROM FILE(?,{headers:true})', [event], function (data) {
            $rootScope.eData = data;     //  eData contains the JSON representation of the Excel sheet rows
        }); 

and the html code is as follows:

<input type="file" ng-mouseleave="loadFile($event)" />

On observing the browser console the issue is

xlsx.full.min.js:21 Uncaught Error: Invalid HTML: could not find <table>
    at e (xlsx.full.min.js:21)
    at Object.r [as to_workbook] (xlsx.full.min.js:21)
    at Pp (xlsx.full.min.js:19)
    at Np (xlsx.full.min.js:19)
    at Object.dg [as read] (xlsx.full.min.js:22)
    at alasql.min.js:2
    at XMLHttpRequest.a.onload (alasql.min.js:11)`

Thanks in advance!!!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gursimran-agilecommented, Sep 5, 2019

thanks a lot @mathiasrw , reading the links provided by works for me, I published my spreadSheet, now it works fine(with the same code). Thanks a lot once again 馃憤 馃槂

1reaction
mathiasrwcommented, Sep 5, 2019

@gursimran-agile

I have a feeling you could do the same with something like

alasql.promise('select * from xlsx("https://docs.google.com/spreadsheets/d/1Xr2IjT8Ohh3fYqoAKIMLiR21AleNMNJ9SXVlkLIn2F4/edit?usp=sharing",{sheetid:?})', sheetName[0])

But to be fair there is actually a plugin only to read data from google spreadsheet. Please have a look at https://github.com/agershun/alasql/wiki/TABLETOP - in the example its loaded directly to a html table, but could just a well be used to load into a DB table (or read out directly).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid HTML: could not find <table> 路 Issue #1110 - GitHub
I had the same issue when I use node to read the excel file in the docker container, it shows Error: Invalid HTML:...
Read more >
Solved: Re: can't find table name after picking up xlsx sh...
I tried using the connector, but the connector can't seem to find Table names as below( actually, /Hakidame/feedtest.xlsx is existing). does ...
Read more >
Error message in Excel when you try to import data from a ...
When you try to import data from a Web source in Microsoft Excel, you may receive an error message that resembles the following:...
Read more >
Fix broken links to data - Microsoft Support
Open the workbook that contains the broken link. 路 On the Data tab, click Edit Links. 路 In the Source file box, select...
Read more >
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 >

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