I am using openpyxl to read from an excel file. I am trying to read a cell whose value is calculated by a formula.
Regular reading functions returns formula script:
`wb= openpyxl.load_workbook('forecast.xlsx')`
`sheet = wb.get_sheet_by_name('Sheet3')`
`result=sheet["F6"].value`
I tried to use (data_only=True) flag like this:
wb= openpyxl.load_workbook('forecast.xlsx', data_only=True)
Result was that all formula cells turned to blanks. Only pure values remained.
Is there a way to read a cell calculated value using openpyxl?
Update:
From further reading I suspect the issue is about re-opening a file that was already modified with openpyxl. Once I open an original file, I get the values using 'data_only'
flag. Once re-opening after some modification, formula cells turn to blanks.
Tried solving this by working with 2 files- so far without much success.
Anybody has a solution for this?