# Writing data to specific cells in the Excel spreadsheet

**URL:** <https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493>\
**Category:** Ignition\
**Created:** [October 29, 2013, 11:33pm UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493 "2013-10-29T23:33:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hari2012](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hari2012](https://forum.inductiveautomation.com/u/hari2012)\
**Post date:** [October 29, 2013, 11:33pm UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493/1 "2013-10-29T23:33:14Z")

</div>

I would like to configure a window to allow the user to generate a report in Excel format. Instead of exporting data from directly dataset to Excel, can I configure the script where I can write data to specific cells in the spreadsheet.

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [October 29, 2013, 11:43pm UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493/2 "2013-10-29T23:43:13Z")

</div>

are you talking about writing to an existing spreadsheet or generating a new spreadsheet?

---

<div class="post-metadata">

**Author:** ![hari2012](https://avatars.discourse-cdn.com/v4/letter/h/51bf81/32.png) [@hari2012](https://forum.inductiveautomation.com/u/hari2012)\
**Post date:** [October 29, 2013, 11:51pm UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493/3 "2013-10-29T23:51:15Z")

</div>

To an existing spreadsheet

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [October 30, 2013, 9:15am UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493/4 "2013-10-30T09:15:52Z")

</div>

Here is an example of how to do this.

Using the window provided, your excel sheet must match roughly the same layout as the source test file. Really, you need a header row as the first row. Check the cellUpdate event for an example of how to edit the file.

Also, you need the module located here  
[Office Document Module](http://www.inductiveautomation.com/modulemarket/moduledetail?1&moduleId=73)  
This module is a licensed module, but the methods from the module that are used in the above example as not licensed. They will run even after the module has expired.

On a side note, we are looking at making an Excel component. Anyone interested in a more feature rich component?

* * *

Test Source Excel file is located [here](https://dl.dropboxusercontent.com/u/27038068/test.xlsx)

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [October 31, 2013, 1:05am UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493/5 "2013-10-31T01:05:51Z")

</div>

> [@](#):
>
> On a side note, we are looking at making an Excel component. Anyone interested in a more feature rich component?

what exactly are you talking about? I know some of my customers would like things like being able to color cells and such on exports, which I dont think can be done in ignition currently.

---

<div class="post-metadata">

**Author:** ![toughautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/toughautomation/32/27171_2.png) [@toughautomation](https://forum.inductiveautomation.com/u/toughautomation)\
**Post date:** [May 2, 2019, 5:47pm UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493/6 "2019-05-02T17:47:08Z")

</div>

@diat150 did you ever get this to work? I’m tasked with the same problem, and I’m curious how it turned out for you, and would you be interested in being hired to do the same for me? @Kyle_Chase you may have someone you can recommend for handling this, assuming you aren’t interested? I just now saw this was over 5 years ago, so this topic may have changed over that time.

---

<div class="post-metadata">

**Author:** ![alexmarcy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alexmarcy/32/4653_2.png) [@alexmarcy](https://forum.inductiveautomation.com/u/alexmarcy)\
**Post date:** [May 2, 2019, 6:03pm UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493/7 "2019-05-02T18:03:28Z")

</div>

This can all be done relatively easily with the XlsxWriter library.

> **[jmcnamara/XlsxWriter](https://github.com/jmcnamara/XlsxWriter)**
>
> A Python module for creating Excel XLSX files. Contribute to jmcnamara/XlsxWriter development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [May 2, 2019, 6:48pm UTC](https://forum.inductiveautomation.com/t/writing-data-to-specific-cells-in-the-excel-spreadsheet/7493/8 "2019-05-02T18:48:49Z")

</div>

I just responded to your email. We should be able to help you out.
