XLSX.jl icon indicating copy to clipboard operation
XLSX.jl copied to clipboard

writetable with multiple sheets generates .xlsx file with only one sheet visible to applications with less robust .xlsx readers

Open David-Howe opened this issue 3 years ago • 2 comments

When using writetable to create an .xlsx file with multiple sheets, only a single sheet is visible when opened in some applications, for example: Tableau. I believe this is because only a single sheet tag is generated in the [Content_Types].xml component of the .xlsx file, where there should be a tag for each sheet.

The work around is to open the newly generated file in Excel first and then save the changes before opening in the other application.

I wish to avoid the work-around step as I'm creating an automated workflow using Julia and Tableau. Is this something that can be addressed?

David-Howe avatar Dec 09 '20 03:12 David-Howe

Can you confirm that editing ContentTypes file fixes the problem?

felipenoris avatar Dec 09 '20 14:12 felipenoris

Hi Felipe, Yes. I've just now edited the .xlsx file and added extra sheet tags. The added sheets are now visible when opening in Tableau.

The sheet tag is: <Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/> Each new tag needs to have the sheet name in the xml path incremented by 1: /sheet2.xml, /sheet3.xlml, etc. I hope this helps.

David-Howe avatar Dec 09 '20 21:12 David-Howe