Reputation: 99
I've got a daily automated function in nodejs which builds and populates an excel spreadsheet via the package xlsx-populate
, which has been running for a couple of years now with no problems.
A colleague now wants to connect this file with Power Bi, but an error occurs saying:
The input couldnt be recognised as a valid Excel Document.
DataFormat.Error: The document cannot be opened because there is an invalid part with an unexpected content type.
I believe (from this article here) that it's due to a issue within the xlsx-populate package, not saving xml correctly.
When we open, save and close the excel file (without making any changes), it works perfectly.
Is there a way that my automated function can open, save and close the spreadsheet to avoid the need to manually do this each day? Or perhaps there's another way around the problem which I haven't thought of.
Thanks
Upvotes: 0
Views: 37
Reputation: 400
Assuming you really just want to do what you ask...I don't see the need to tie this into the same programmatic interface, since you're effectively hacking through to a solution anyway. Decouple it from your infrastructure and just use another process script to do the excel open/close. Here is another link to an answer for how to do this, that should guide you: Open, save and close an Excel file from the command prompt without interaction
you could of course call it from this process, or set a scheduler/timer to activate it, and so on. Given the lack of other details, this should answer your question asked.
Upvotes: 1