# Read Excel workbook

**URL:** <https://forum.inductiveautomation.com/t/read-excel-workbook/40988>\
**Category:** 3rd Party Modules\
**Tags:** ignition79, scripting\
**Created:** [November 26, 2020, 11:35am UTC](https://forum.inductiveautomation.com/t/read-excel-workbook/40988 "2020-11-26T11:35:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsnaik](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@rsnaik](https://forum.inductiveautomation.com/u/rsnaik)\
**Post date:** [November 26, 2020, 11:35am UTC](https://forum.inductiveautomation.com/t/read-excel-workbook/40988/1 "2020-11-26T11:35:15Z")

</div>

Hi,

I am working on a project where i want to load/update around 100 recipe at a time in MySQL database.

To achieve this we planned to import excel sheet (.xlsx format) in to ignition tag and using transition group or by database script we can load it in MySQL.

We tried using xlrd python lib version ( 0.7.9 ) since my ignition version is 7.9.16. with this we can achieve the goal but the xlrd 0.7.9 version can extract data from old excel version ( .xls format ).

Is there any other way to read to excel workbook using script. we don’t want to import any new module in platform.

Thanks in advance.  
Cheers!!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 26, 2020, 4:39pm UTC](https://forum.inductiveautomation.com/t/read-excel-workbook/40988/2 "2020-11-26T16:39:56Z")

</div>

[Apache POI](https://poi.apache.org/) is the recommended tool for working with Excel files (reading and writing, including the modern .xlsx) in java/jython. With Ignition v7.9.x, you will need to include a 3rd-party module that provides and exposes them. I recommend Kymera’s Office Document module from the module showcase.

In Ignition v8.1, the Apache POI libraries v4.1.1 are included in Ignition’s core and can be imported in jython directly.

(You can also hack your Ignition install to have those libraries, but such hacks won’t survive an Ignition upgrade.)

---

<div class="post-metadata">

**Author:** ![Daniel\_Drendall](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@Daniel\_Drendall](https://forum.inductiveautomation.com/u/Daniel_Drendall)\
**Post date:** [January 11, 2022, 5:38pm UTC](https://forum.inductiveautomation.com/t/read-excel-workbook/40988/3 "2022-01-11T17:38:25Z")

</div>

I know it’s stale, but such a corner case.

I’ve explored with good success, using a .NET-based client/server tool that exposes individual cells to the OPCUA protocol via the native Excel RTD() function. It’s called “Excel Option for QuickOPC”, made by OPC Labs. You can find them on the OPC Foundation website as a registered member.

There’s a single ~$1200 licensing fee if memory serves, but you can get a trial, and get it extended by request.

My intended use was treating an Excel file like a PLC, and used the SQL bridge to link cells from various spreadsheets to a single parameter in a SQL database, or with OPC tags.

Seemed applicable to your recipe case.

Good luck!!

\*\*Disclaimer: I’m in no way affiliated or have vested interest in OPC Labs as a company, except being an arms-length customer.

---

<div class="post-metadata">

**Author:** ![Pat\_Cunningham](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pat_cunningham/32/57710_2.png) [@Pat\_Cunningham](https://forum.inductiveautomation.com/u/Pat_Cunningham)\
**Post date:** [January 3, 2024, 11:52am UTC](https://forum.inductiveautomation.com/t/read-excel-workbook/40988/4 "2024-01-03T11:52:17Z")

</div>

Are there any examples of this?

> [@pturmel](#):
>
> In Ignition v8.1, the Apache POI libraries v4.1.1 are included in Ignition’s core and can be imported in jython directly.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 3, 2024, 1:19pm UTC](https://forum.inductiveautomation.com/t/read-excel-workbook/40988/5 "2024-01-03T13:19:37Z")

</div>

> [@Pat\_Cunningham](#):
>
> Are there any examples of this?

Here you go:

> [@Copying an Excel file to a table's dataset](https://forum.inductiveautomation.com/t/copying-a-excel-file-to-a-tables-dataset/34942/13):
>
> Got my paperwork done early, so here's a sample to read from an Excel file EDIT: Reworked a bit to work with both .xls and .xlsx files EDIT: Modified to properly cast data types EDIT: Added handler for formula cell types EDIT: Added parameters to optionally specify sheet, row, and column numbers Reading back a file created from my other example: def excelToDataSet(fileName, hasHeaders = False, sheetNum = 0, firstRow = None, lastRow = None, firstCol = None, lastCol = None): import org.apac…

---

<div class="post-metadata">

**Author:** ![Pat\_Cunningham](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pat_cunningham/32/57710_2.png) [@Pat\_Cunningham](https://forum.inductiveautomation.com/u/Pat_Cunningham)\
**Post date:** [January 3, 2024, 1:50pm UTC](https://forum.inductiveautomation.com/t/read-excel-workbook/40988/6 "2024-01-03T13:50:50Z")

</div>

That is exactly what I need. Thank you.
