Generate xlsx with multipel sheet

hello i’m using an n8n workflow in order to generate and xlsx file with multiple sheet , every sheet will take the output of js code node .could you help me please with that

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @wassim_jguirim, Are you open to use something like Google Sheets and then download the file as xlsx? It will be a lot easier to handle the different sheets like this, or unless you have a Microsoft Excel 365 account, then that would be your best bet. Using the Convert to file node is limited to 1 sheet at a time

it’s my first time working on such use case i try both node but i couldn’t handel it

Here is an example of writing two different sets of sample data (from the star wars api - people and planets) to separate sheet tabs on the same google sheet. At the end we then just merg back in and limit to 1 item to download the Google Sheet as a xlsx file.

1 Like

Hi @Wouter_Nigrini, I have the same challenge, but I would have to do it with Microsoft Excel.

You have mentioned it would be easier with Google Sheets. Do you know how to save different extracts to an Excel file in multiple sheets using Microsoft Excel/Sharepoint? Or is this not possible today with the resources of Microsoft nodes? Thanks in advance.

Hi @TobiasD I dont think you can get it done with the Excel node, but you can definitely try the Office 365 node if you have an account.

@Wouter_Nigrini Thank you for sharing this example with us. However, in my use case, the number of columns and their titles are dynamic, so I’m not sure it addresses my issue, but thank you anyway.

@wassim_jguirim you can still achieve dynamic columns in the excel by setting this property to Automatic. I just used manual to prove the concept of multiple sheets.

You can also dynamically add sheets programmatically using this node:

Thank you very much for your feedback @Wouter_Nigrini. This confirms my findings from various attempts and research by getting done this with Microsoft Excel nodes.

I will check whether it works with Office 365 nodes and report back if successful.

hello @Wouter_Nigrini That responds perfectly to my use case, thank you very much!

Perfect! You probably could build your workflow using only 3 nodes after you get your pieces of data, but if the above solves your problem then perfect.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.