catamphetamine / read-excel-file

Read *.xlsx files in a browser or Node.js. Parse to JSON with a strict schema.
https://catamphetamine.gitlab.io/read-excel-file/
MIT License
301 stars 52 forks source link

Error: "styles.xml" file not found in the *.xlsx file #88

Closed goranapivis closed 4 years ago

goranapivis commented 4 years ago

I have no idea why I got this error. I just trying to import an xlsx file that I have dl from my CRM.

node index.js (node:47359) UnhandledPromiseRejectionWarning: Error: "styles.xml" file not found in the *.xlsx file

My simple code:

const xlsxFile = require('read-excel-file/node');

xlsxFile('./Lagerstatus.xlsx').then((rows) => {
    console.log(rows);
    console.table(rows);
   })
catamphetamine commented 4 years ago

Where did you get the file from?

goranapivis commented 4 years ago

From a Swedish CRM called Hyrma.

catamphetamine commented 4 years ago

Looks like it doesn't have styles.xml inside (it's a zip archive).

goranapivis commented 4 years ago

Yes that it's what the error message says. But I don't normally touch Microsoft stuff, so I do not know why it's missing or why it should have an styles.xml.

Can I just add a fake style file somewhere?

goranapivis commented 4 years ago

There is a lot of xml files inside such as [Content_Types].xml and workbook.xml but no styles.xml

goranapivis commented 4 years ago

Ok, switching to csv parser instead, so I don't have to depend on Bill! :-)