0

I am currently doing a project where all computations are done in excel i have multiple references and if conditions, the output of all of this is a number. The input is computed in python, it carries the information to the excel which has all the formulas to compute the output.

I am trying to use the openpyxl library to get this value into my python programm, the written input works well but the last computed number that needs to be extracted as the result or output of the excel is not being done correctly. The output gives the operation not the result of the operation. I have tries using the data_only=True but does not work and the xlwings library solution dies not work either.

I just need a command that once I introduce the input, executes all excel operations so that I can extract the result onto my python programm. ¿how can i do this?

  • Possible duplicate: [Openpyxl 1.8.5: Reading the result of a formula typed in a cell using openpyxl](https://stackoverflow.com/q/23350581/12122460). – kotatsuyaki May 31 '22 at 10:42

1 Answers1

0

I found a solution that might not be the most accurate but it is usefull.It creates a copy of an excel sheet, the main one gathers input and then it is copied to a secondary excel that applying the data_only=True can extract the value of a cell, it destroys the operation in the cell but since taht operation is safe in the original excel it won't matter. To write and read use openpyxl( data_only=True in read option) and to duplicate excel: https://www.geeksforgeeks.org/how-to-create-a-duplicate-file-of-an-existing-file-using-python/