# Excel xlsx export library

**URL:** <https://discourse.nodered.org/t/excel-xlsx-export-library/88615>\
**Category:** General\
**Created:** [11 June 2024 10:28 UTC](https://discourse.nodered.org/t/excel-xlsx-export-library/88615 "2024-06-11T10:28:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephan94](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@stephan94](https://discourse.nodered.org/u/stephan94)\
**Post date:** [11 June 2024 10:28 UTC](https://discourse.nodered.org/t/excel-xlsx-export-library/88615/1 "2024-06-11T10:28:59Z")

</div>

Hi, i am looking for a library to export things to an xlsx file. I already tried some libraries, but at all of them you can´t skip cells. For example after Inject1 i want "test1" in cell1. After this, the flow forgets the information which is in cell1, but i know that i need to write the next value after inject2 in cell2 afterwards.

All libraries i tried, the flow needed to save the informations from every cell, i couldn´t skip existing cells.

Does anyone know a xlsx library, where i can tell information xy goes to cell x? Otherwise i would need to write everything in a database first and then export the whole database to xlsx. But i want to cyclic add information in an existing xlsx file.

Thanks, Stephan

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [11 June 2024 12:02 UTC](https://discourse.nodered.org/t/excel-xlsx-export-library/88615/2 "2024-06-11T12:02:35Z")

</div>

You cannot do this the way you describe. Saving an Excel file, by definition, saves whatever is in the file at time of save.

You have a couple of choices. Either manage the data in a JavaScript object (e.g. an array of objects where each inner object is a set of column-name/value pairs which is directly mappable to an Excel sheet) and make sure that object contains the right data and time of save to file.

Or, use a library that allows direct manipulation of Excel cells.

---

<div class="post-metadata">

**Author:** ![stephan94](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@stephan94](https://discourse.nodered.org/u/stephan94)\
**Post date:** [11 June 2024 15:50 UTC](https://discourse.nodered.org/t/excel-xlsx-export-library/88615/3 "2024-06-11T15:50:37Z")

</div>

I think you misunderstood me. Saving is not the problem. I could save after each array of information. But the xlsx libraries i found fill the cells from begin.

I‘d need a library where i can fill specific cells, for example a12 to f12, then save and close and after next inject fill array in a13 to f13, save, close. Next inject: open file, fill array in a14 to f14, save, close and so on.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [11 June 2024 17:50 UTC](https://discourse.nodered.org/t/excel-xlsx-export-library/88615/4 "2024-06-11T17:50:07Z")

</div>

This looks like it might do what you want. I've not tried it though.

> **[@eyeseetea/xlsx-populate](https://www.npmjs.com/package/@eyeseetea/xlsx-populate)**
>
> Excel XLSX parser/generator written in JavaScript with Node.js and browser support, jQuery/d3-style method chaining, and a focus on keeping existing workbook features and styles in tact.. Latest version: 4.3.0, last published: 3 months ago. Start...

I think this might work as well:

> **[excel-calculator](https://www.npmjs.com/package/excel-calculator)**
>
> ExcelCalculator is an npm package for dynamic Excel data manipulation and calculation, powered by exceljs and mathjs.. Latest version: 1.0.19, last published: 3 months ago. Start using excel-calculator in your project by running \`npm i...

There are hundreds of other node.js libraries on npmjs most of which should work with Node-RED with a bit of work.

---

<div class="post-metadata">

**Author:** ![benefit\_union](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@benefit\_union](https://discourse.nodered.org/u/benefit_union)\
**Post date:** [11 June 2024 18:13 UTC](https://discourse.nodered.org/t/excel-xlsx-export-library/88615/5 "2024-06-11T18:13:21Z")

</div>

I also need save data with xlsx file.can U tell me which node you use to save data with xlsx formate.

---

<div class="post-metadata">

**Author:** ![stephan94](https://avatars.discourse-cdn.com/v4/letter/s/58f4c7/32.png) [@stephan94](https://discourse.nodered.org/u/stephan94)\
**Post date:** [11 June 2024 18:52 UTC](https://discourse.nodered.org/t/excel-xlsx-export-library/88615/6 "2024-06-11T18:52:47Z")

</div>

@TotallyInformation thanks, this is exactly what i was looking for!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 June 2024 18:53 UTC](https://discourse.nodered.org/t/excel-xlsx-export-library/88615/7 "2024-06-25T18:53:03Z")

</div>

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