Load XLS usnig Apache Poi

Hi! Have a problem using the Jar POI. When import **from org.apache.poi.hssf.usermodel import * ** in some cases it works, and others do not. For example, I’m working on the designer and all ok, but trying to run the script on the client shows me the following:

ImportError: No module named poi

After this happens, I close the designer and re-open it and the same error occurs.

I noticed that in the folder:

C:\Program Files\Inductive Automation\Ignition\lib\core\gateway (And in other folders from \lib\core)

is in the file poi-3.14.jar

Do you have any idea what is happening or how to solve this?

PD: What I need is to load an exel file.

1 Like

It should work if you import the classes you need directly. Here is an example:

from org.apache.poi.xssf.usermodel import XSSFWorkbook

Also, this tutorial on Apache POI in Ignition might be helpful: http://blog.perfectabstractions.com/2017/04/05/using-the-pa-office-document-module/

That blog post shows an example of loading an Excel file into an Ignition Power Table.

Now receive this error

Try downloading and installing the PA Office Document Module to see if it works with that. You can download it here: http://www.perfectabstractions.com/products.html

Is there any free way to do it? Even with python?