How to read all sheets from an Excel file (.xls/.xlsx) and split them into separate files in n8n

Hello everyone!
I’m hosting N8N locally on a server in my company.
I want to build a workflow but I’m stuck on a step that seems simple, yet I can’t find a solution. Let me explain:

Goal of the workflow:
As input, I have a form that uploads a .xls or .xlsx file.
This Excel file can contain multiple sheets within the same file.
The goal is to read the file in its entirety and create a new separate file for each sheet of the original Excel.
So, the final output should be multiple files, each containing only a single sheet.

Problem:
When I use the node “Extract from XLS” or “Extract from XLSX”, it only returns the first sheet of the file as JSON — as if the other sheets don’t exist.

Thanks for your help!

yes it only returns one sheet.

but you can extract other by giving their name:

Hello,
Thanks a lot for your reply!
This indeed allows me to extract multiple sheets when I already know their names, which is a great start!

Do you know if there’s a way to extract each sheet even if I don’t know their names in advance?
For example, instead of relying on the sheet name, it would take into account the sheet index (Sheet 1, Sheet 2, etc.).

I’m asking because in my workflow, the original Excel file can contain several sheets, but their names may change from one file to another.

Thanks again for your help!

you can checkout this post: How to read a list of sheets from a Spreadsheet

but excel from onedrive gives more options.
hope it helps

1 Like

Yes you can using this trick. An excel file is simply a zip archive with a bunch of xml files inside. By reading the content of xl/workbook.xml you can get a list of the sheet names. Once you have this you can process as needed in a loop. Let me know if you need me to complete the sample in actually writing out separate excel files per sheet or whether you want to process each sheet from here

Here is the more complete version to read each sheet dynamically. This excludes writing each sheet to a new file. Not sure if this is enough for your requirement or whether you actually want to split the file into multiple files?

1 Like

Hello everyone !
Thank you very much for your help !
Now my problem is solved :slight_smile:

Best Regards,
Wei-EN.

That is great news! Please can you mark the solution to help others with the same issue. This also helps our stats

Is it possible to do it without having access to the local host? Im having problems with it

Are you using a self hosted instance of n8n or the cloud version? Technically you always have access to a host even if it is in cloud, so I would just store the file temporarily, process and then delete it. If you’re asking if you can do this on a remote host, then the node to use is the “ssh - execute command”

1 Like

Hi,

I’m working on an n8n workflow that processes uploaded XLSX/CSV files from a form submission. The issue is that the Read Excel Workbook node isn’t reading the binary files properly after upload. The workflow should extract data, convert XML to JSON, split items, loop through them, and extract from sheets, but it’s failing at the Excel reading step. Could you please guide me on how to properly configure the binary data flow and ensure the entire workflow runs correctly from form submission to final extraction?

Thank you!

1 Like

Yes, Im using a remote host, thats why im confused about it. And Im trying to do the same thing as Raja_Asad, upload XLSX/CSV files from a form submission and then read all the content in all of the sheets so I can work with it. Im not sure how to set the path for the “Read Excel Workbook” node using the remote host.

You will need to download the file to the host first for this to work. Lemme see if I can fix the workflow

See if my last answer helps your case as well. You just need to adjust the filename path and make sure the directory exist. if you struggle i can try and create an example


I did verify the existance of the directory and it is writable, but stiill Im having problems writing on it.

I would maybe avoid trying to write to the .n8n folder. Rather create a new folder somewhere else in your home dir and try and save the file there

2 Likes

hi thank you for ur reply in n8n now issues this and i need one more help suppose in n8n in quick book data extract first time 5 invoice show and second time 10 but i need only 5 new invoice how to fix this and guide me in data extract and guide me this

Just make sure the directory you’re trying to store the file in exists. Either create it on your server or run a shell command before the store step to make sure the directory exists.

Thank you for your previous assistance. I’m currently facing a few issues related to QuickBooks data extraction and upload:

  1. Invoice Extraction Issue:

    • During the first extraction, 5 invoices are shown.

    • On the second extraction, 10 invoices appear instead of only the 5 new ones.

    • I need to extract and upload only the 5 new invoices each time.

  2. Upload Issue:

    • I’m using an HTTPS Node to upload data to QuickBooks.

    • The XML file uploads successfully, but PDF files are not uploading.

  3. Sales Order Extraction Issue:

    • QuickBooks does not extract data from the Sales Order section, even after multiple attempts and research.

Could you please guide me on how to:

  • Extract only new invoices automatically (avoid duplicates).

  • Enable PDF upload in addition to XML.

  • Successfully extract data from the Sales Order section.

Thank you for your time and support. I look forward to your guidance.