I have 3 xlsx files - one a kind of interface and the other two for doing calculations. I need to change some cells in the interface's input sheet and obtain the value from the result cell (in another sheet in the same interface file). The interface file is linked to each of the other two, but the last are not interconnected.
The code below gets executed without errors, but the res_cell is not updated (if I read it using getValue in the end).
from ooodev.utils.lo import Lo
from ooodev.calc import Calc
loader = Lo.load_office(Lo.ConnectSocket(headless=True))
core_module_ref_doc = Lo.open_doc(fnm=core_module_ref_file, loader=loader)
core_module_scen_doc = Lo.open_doc(fnm=core_module_scen_file, loader=loader)
interface_doc = Lo.open_doc(fnm=interface_file, loader=loader)
input_sheet = Calc.get_sheet(interface_doc, sheet_name='Input')
res_sheet = Calc.get_sheet(interface_doc, sheet_name='Res')
input_cell = input_adattamento_sheet.getCellByPosition(8, 35) # (column,row)
res_cell = risultati_di_trasporto_sheet.getCellByPosition(40, 41) # (column,row)
input_cell.setValue(10)
interface_doc.calculateAll()
time.sleep(3)
core_module_scen_doc.calculateAll()
time.sleep(3)
interface_doc.calculateAll()