# OnFileReceived - Excel Workbook

**URL:** <https://forum.inductiveautomation.com/t/onfilereceived-excel-workbook/83319>\
**Category:** Ignition\
**Created:** [December 19, 2023, 4:23pm UTC](https://forum.inductiveautomation.com/t/onfilereceived-excel-workbook/83319 "2023-12-19T16:23:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [December 19, 2023, 4:27pm UTC](https://forum.inductiveautomation.com/t/onfilereceived-excel-workbook/83319/2 "2023-12-19T16:27:03Z")

</div>

You can use the Apache POI libraries embedded into Ignition to do this. Take the event's file bytes, wrap with a `ByteArrayInputStream` and feed it to the POI library. You get an in-memory spreadsheet from which you can extract any arbitrary sheets and cell values (or iterate through them).

Start here:

> [@Copying an Excel file to a table's dataset](https://forum.inductiveautomation.com/t/copying-a-excel-file-to-a-tables-dataset/34942/18):
>
> Untested, but you should just be able to use ByteArrayInputStream instead. def excelBytesToDataSet(bytesIn, hasHeaders = False): import org.apache.poi.ss.usermodel.WorkbookFactory as WorkbookFactory import org.apache.poi.ss.usermodel.DateUtil as DateUtil from java.io import ByteArrayInputStream fileStream = ByteArrayInputStream(bytesIn) ...

---

_[View the full topic](https://forum.inductiveautomation.com/t/onfilereceived-excel-workbook/83319)._
