Close a workbook with openpyxl

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. 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 !!