I am using openpyxl to read cell value (excel addin-webservice update this column. )
I have used data_only = True
but it is not showing the current cell value instead it is the value stored the last time Excel read the sheet.
wbFile = openpyxl.load_workbook(filename = xxxx,data_only=True) wsFile = wbFile[c_sSheet]
How can i read the cell actual value ?
You can do this using F9 in the formula bar: If you select/highlight any term in your formula and press F9 , it will get evaluated and the value is shown instead of the term. E.g. in your example, if you highlight A1 your formula will become =2+B1 .
wb = openpyxl.load_workbook(filename, data_only=True)
The data_only
flag helps.
As @alex-martelli says, openpyxl does not evaluate formulae. When you open an Excel file with openpyxl you have the choice either to read the formulae or the last calculated value. If, as you indicate, the formula is dependent upon add-ins then the cached value can never be accurate. As add-ins outside the file specification they will never be supported. Instead you might want to look at something like xlwings which can interact with the Excel runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With