# Close a workbook with openpyxl

**URL:** <https://forum.inductiveautomation.com/t/close-a-workbook-with-openpyxl/55720>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [February 3, 2022, 4:32pm UTC](https://forum.inductiveautomation.com/t/close-a-workbook-with-openpyxl/55720 "2022-02-03T16:32:32Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![g.cascales](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@g.cascales](https://forum.inductiveautomation.com/u/g.cascales)\
**Post date:** [February 4, 2022, 6:36am UTC](https://forum.inductiveautomation.com/t/close-a-workbook-with-openpyxl/55720/5 "2022-02-04T06:36:40Z")

</div>

Hello,

I just tried with this code, and I got the cell value correctly showed in the label. However, **I can´t still delete the file**.

`
from openpyxl import Workbook
from openpyxl import load_workbook
import os
upload_path = “” #whatever
sheetName = “” #whatever
wb = load_workbook(upload_path)
ws = wb[sheetName]
cellValue = ws[“C6”]
wb.save(upload_path) #using both wb.save(upload_path) and wb.close() it does not work
self.getSibling(“Label”).props.text = cellValue.value
`

The “upload\_path” variable is using the format: C:\Users\GENIOTIC\Desktop\PruebasIgnition\Filename.xlsx

Two more notes:

- I also wanted to try with the pylight library, but I am stuck because I do not know exactly what files/folders I need to copy to the Ignition directory.

- I am already using the function created by @JordanCClark [Copying a Excel file to a tables Dataset - #13 by JordanCClark](https://forum.inductiveautomation.com/t/copying-a-excel-file-to-a-tables-dataset/34942/13). But I am not able to find out how to **get the value of a specific cell indicating the address** (i.e. “C6”) instead of row and column numbers. I have been reading some of the Apache POI documentation and I think I need to create a cell reference but I still do not know how.

Thanks !!

---

_[View the full topic](https://forum.inductiveautomation.com/t/close-a-workbook-with-openpyxl/55720)._
