# To change the value of a specific cell in Excel file

**URL:** <https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634>\
**Category:** General\
**Created:** [17 August 2023 19:03 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634 "2023-08-17T19:03:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![antoniosm](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@antoniosm](https://discourse.nodered.org/u/antoniosm)\
**Post date:** [17 August 2023 19:03 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/1 "2023-08-17T19:03:31Z")

</div>

Hi,  
I need to change the value on a specific cell in an Excel file using a function.  
I already searched for the solution in many topics, but I didn't find it.  
Is this possible on Node Red?

thanks in advance

Antonio

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [17 August 2023 19:08 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/2 "2023-08-17T19:08:12Z")

</div>

Have a look at [node-red-contrib-excelsheets (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-excelsheets) , never used it myself so can't confirm if it will do the job.

---

<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:** [17 August 2023 19:22 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/3 "2023-08-17T19:22:54Z")

</div>

I think this question came up recently before. Maybe also try searching the forum for previous answers.

---

<div class="post-metadata">

**Author:** ![antoniosm](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@antoniosm](https://discourse.nodered.org/u/antoniosm)\
**Post date:** [17 August 2023 19:33 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/4 "2023-08-17T19:33:27Z")

</div>

Hi... this node only create a excel file, not to update data.  
thanks.

---

<div class="post-metadata">

**Author:** ![antoniosm](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@antoniosm](https://discourse.nodered.org/u/antoniosm)\
**Post date:** [17 August 2023 19:34 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/5 "2023-08-17T19:34:30Z")

</div>

could you try to help me?  
I didn't founded the solution.

thanks

---

<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:** [17 August 2023 19:38 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/6 "2023-08-17T19:38:43Z")

</div>

[Search results for 'excel' - Node-RED Forum (nodered.org)](https://discourse.nodered.org/search?q=excel)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 August 2023 19:47 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/7 "2023-08-17T19:47:42Z")

</div>

> [@antoniosm](#):
>
> this node only create a excel file, not to update data

node-red-contrib-spreadsheet-in will read in a spreadsheet.

---

<div class="post-metadata">

**Author:** ![antoniosm](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@antoniosm](https://discourse.nodered.org/u/antoniosm)\
**Post date:** [17 August 2023 19:57 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/8 "2023-08-17T19:57:43Z")

</div>

Hi Colin,  
Maybe I'm wrong, but it seems the node write a spreadsheet.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aa67e6530a77484c70bfcbbf6ca308ee932331be.png)

---

<div class="post-metadata">

**Author:** ![antoniosm](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@antoniosm](https://discourse.nodered.org/u/antoniosm)\
**Post date:** [17 August 2023 19:59 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/9 "2023-08-17T19:59:14Z")

</div>

Thanks... but there not a solution for change the value on a specific cell from a Excel file.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 August 2023 20:03 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/10 "2023-08-17T20:03:25Z")

</div>

That is the wrong node. Read my post again. More carefully this time.

---

<div class="post-metadata">

**Author:** ![antoniosm](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@antoniosm](https://discourse.nodered.org/u/antoniosm)\
**Post date:** [17 August 2023 20:13 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/11 "2023-08-17T20:13:22Z")

</div>

You're right! sorry.  
But, I don't need to read a file, but I need the write a value in a specific cell in a Excel file.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 August 2023 20:22 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/12 "2023-08-17T20:22:29Z")

</div>

> [@antoniosm](#):
>
> But, I don't need to read a file,

Yes you do, you need to read the file, replace the cell, and write it out again.

---

<div class="post-metadata">

**Author:** ![antoniosm](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@antoniosm](https://discourse.nodered.org/u/antoniosm)\
**Post date:** [17 August 2023 20:27 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/13 "2023-08-17T20:27:27Z")

</div>

I understood, but it is a very complex spreadsheet, even so thank you very much.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [17 August 2023 20:31 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/14 "2023-08-17T20:31:26Z")

</div>

An alternative strategy might be to look for a command line utility that can do what you want. Then you could run that from node-red using an exec node. I don't know whether there is such a tool, but I am sure your favourite search engine will help.

---

<div class="post-metadata">

**Author:** ![antoniosm](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@antoniosm](https://discourse.nodered.org/u/antoniosm)\
**Post date:** [17 August 2023 20:43 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/15 "2023-08-17T20:43:59Z")

</div>

Thanks Colin!  
I'm tring to look for that solution, but is not easy because Excel it's hard to manipulate from external programs.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 August 2023 21:04 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/16 "2023-08-17T21:04:13Z")

</div>

Pretty much why most people make reports in web pages or pdf. Writing to excel is a pain. Macros get damaged, cell references don't get updated, charts stop working.

If your spreadsheet is an xlsx it should be possible to unzip it, modify the XML, re-zip and save.

Tbf, it's been a while since I had to do this - the node packages may have improved by now.

---

<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:** [17 August 2023 21:42 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/17 "2023-08-17T21:42:00Z")

</div>

Really?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/90a940e8a0629e313f0859c62a141a567b52ff8b.png)

---

<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:** [17 August 2023 21:59 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/18 "2023-08-17T21:59:56Z")

</div>

> [@Steve-Mcl](#):
>
> Pretty much why most people make reports in web pages or pdf. Writing to excel is a pain. Macros get damaged, cell references don't get updated, charts stop working.
> 
> If your spreadsheet is an xlsx it should be possible to unzip it, modify the XML, re-zip and save.

Sorry, Steve but I have to disagree here. Excel is one of the best defined and understood file formats. There are dozens of libraries capable of manipulating xlsx files and manipulating tabular data in xlsx or CSV formats is one of the most common data manipulation tasks in many industries.

Sadly, JavaScript isn't as good as Python for manipulating Excel. If it were, Node-RED would be even more useful in many enterprise, health, government and scientific settings. But there are still plenty of options.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 August 2023 22:13 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/19 "2023-08-17T22:13:52Z")

</div>

I will admit to having not done this for some time. And I did say things may have improved.

A 5~10 years back, I tried about 8 different libraries. They all worked to a certain degree. You could write to cells or bind an array etc, but they all had one or more of the issues I mentioned. Admittedly, this was before xlsx became the default (everyone was still using xls (bof format)). In the end, I wrote my own.

Ultimately, everything became web or pdf. Problem solved.

---

<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:** [17 August 2023 22:36 UTC](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634/20 "2023-08-17T22:36:48Z")

</div>

Well, we agree that JavaScript doesn't have the mature libraries that Python does sadly. A source of ongoing annoyance in my line of work. But there are ones that work.

Web/PDF isn't an answer for structured tabular data though. CSV and xlslx remain king there. And Excel will remain the tool of choice for most business users needing tabular data manipulation.

[Next page](https://discourse.nodered.org/t/to-change-the-value-of-a-specific-cell-in-excel-file/80634.md?page=2)
