openpyxl read formula value without changing formula

℡╲_俬逩灬. 提交于 2020-02-05 03:37:12

问题


I want to read the formula value in an xlsx file, write the value in another cell and store the xlsx file.

I'm using the data_only mode

excelDoc = openpyxl.load_workbook(clientFile, data_only=True)

to read the formula value. But when I save the file all formulas are overriden by their values.

How can I prevent that?


回答1:


You can't. You can either have the values or the formulae.



来源:https://stackoverflow.com/questions/40000170/openpyxl-read-formula-value-without-changing-formula

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!