Python Forum
Reading from Excel: value not formula! - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Reading from Excel: value not formula! (/thread-30628.html)



Reading from Excel: value not formula! - faryad13 - Oct-28-2020

Hi everybody

I am trying to read some data from an excel file in python. Here is a part of my code:
def main():


xl_element = utils.XlsxOpen(r'C:\..........sheet1.xlsx' )
value_1=utils.XlsxGetCellValue(xl_element, "Sheet1", 0 ,0)

print (value_1)

if __name__ == '__main__':
main()
The problem is that when it reads from excel, for the cells I have a formula it shows the formula , not the value calculated.
for example I have a cell with "COUNTA(F5:H5)" formula and value "2",... I need to save value in a variable in python not the formula.

Does anybody can help me?

Thank you.