# Apache.poi.hssf access from script console for excel import

**URL:** <https://forum.inductiveautomation.com/t/apache-poi-hssf-access-from-script-console-for-excel-import/59893>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [May 23, 2022, 6:58am UTC](https://forum.inductiveautomation.com/t/apache-poi-hssf-access-from-script-console-for-excel-import/59893 "2022-05-23T06:58:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryce\_Newton](https://avatars.discourse-cdn.com/v4/letter/b/8dc957/32.png) [@Bryce\_Newton](https://forum.inductiveautomation.com/u/Bryce_Newton)\
**Post date:** [May 23, 2022, 6:58am UTC](https://forum.inductiveautomation.com/t/apache-poi-hssf-access-from-script-console-for-excel-import/59893/1 "2022-05-23T06:58:57Z")

</div>

Hi,

I am hoping to import data from an excel sheet to Ignition. At first I thought openpyxl but couldn't get that to work (saw a post about openpyxl having C dependencies and not working in Jython). Next was org.apache.poi.hssf but it appears these functions aren't available via script console.

> import org.apache.poi  
> dir(org.apache.poi)  
> # '[\_\_name\_\_]'

I can find both poi-4.1.1.jar and poi-ooxml-4.1.1.jar in Ignition/lib/core/common which are the requirements listed in the poi documentation, so I thought that would be enough to get access to the poi libraries (I'm very new to Java though). It looks like the next step is either buying or making an Ignition module, which is why I'm asking for assistance now.

I saw similar topics previously but they were from 2017 and used poi-3.1.14 so I wasn't sure if there had been a change, eg.:  
[Importing and using 3rd party Java jar libraries in Ignition - General Discussion - Inductive Automation Forum](https://forum.inductiveautomation.com/t/importing-and-using-3rd-party-java-jar-libraries-in-ignition/11342)

---

<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:** [May 23, 2022, 12:16pm UTC](https://forum.inductiveautomation.com/t/apache-poi-hssf-access-from-script-console-for-excel-import/59893/2 "2022-05-23T12:16:02Z")

</div>

Jython generally does not support listing contents of java packages. You must import explicitly (no wildcards). I recommend imports of the form:

```auto
from org.apache.poi.hssf import SomeClass, SomeOtherClass

```

---

<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:** [May 23, 2022, 12:58pm UTC](https://forum.inductiveautomation.com/t/apache-poi-hssf-access-from-script-console-for-excel-import/59893/3 "2022-05-23T12:58:42Z")

</div>

> [@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:** ![Ganesh\_Chaudhari](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@Ganesh\_Chaudhari](https://forum.inductiveautomation.com/u/Ganesh_Chaudhari)\
**Post date:** [October 12, 2023, 10:55am UTC](https://forum.inductiveautomation.com/t/apache-poi-hssf-access-from-script-console-for-excel-import/59893/4 "2023-10-12T10:55:08Z")

</div>

I am trying to import usermodel from org.apache.poi.hssf but it shows  
error:  
Traceback (most recent call last):  
File "", line 1, in   
ImportError: No module named hssf

 ![Snap1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/5/558ae85e125090b90740c5158fcccdeabcd16fe6.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 12, 2023, 11:11am UTC](https://forum.inductiveautomation.com/t/apache-poi-hssf-access-from-script-console-for-excel-import/59893/5 "2023-10-12T11:11:26Z")

</div>

What version of Ignition are you using?
