You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've spent the last week troubleshooting an issue that Microsoft Excel reports the generated XLSX as corrupted, while it can be opened just fine in other editors like LibreOffice. Turns out the XLTX file I'm using as a template has some special markers in the file that marks it as "template", and Microsoft Excel will refuse to open it unless its extension is XLTX.
So I'm asking if it is possible to add support for handling of the marker on save i.e. change the template marker to normal workbook if saving as *.xlsx? Judging from the git diff of uncompressed XML files, it shouldn't be too hard to fix. (But I'm not sure if you plan to support such feature, because, you know, it's named XLSX populate)
Steps to reproduce
Open an Excel file or create a new Excel file, in Microsoft Excel, select File -> Save / Save As, select file type "Excel Template (*.xltx)" (let's name it example.xltx here)
Run the following code in node.js, make sure example.xltx is in the current working directory.
constapp=require('express')()constpath=require('path')constexcel=require('xlsx-populate')app.get('/',async(req,res,next)=>{letworkbook=awaitexcel.fromFileAsync(path.join(// ./example.xltxprocess.cwd(),'example.xltx'))letsheet1=workbook.sheet('Sheet1')// do some modification based on the templatesheet1.find('{{Name}}','newName')letdata=workbook.outputAsync()res.attachment('output.xlsx')res.send(awaitdata)}).listen(3000)
I've spent the last week troubleshooting an issue that Microsoft Excel reports the generated XLSX as corrupted, while it can be opened just fine in other editors like LibreOffice. Turns out the XLTX file I'm using as a template has some special markers in the file that marks it as "template", and Microsoft Excel will refuse to open it unless its extension is XLTX.
So I'm asking if it is possible to add support for handling of the marker on save i.e. change the template marker to normal workbook if saving as *.xlsx? Judging from the git diff of uncompressed XML files, it shouldn't be too hard to fix. (But I'm not sure if you plan to support such feature, because, you know, it's named XLSX populate)
Steps to reproduce
Workaround
Just save the template as normal XLSX file
The text was updated successfully, but these errors were encountered: