python 2.7 - After writing formulae into excel sheet with xlwt, reading cells with formulae by xlrd returns blank -
i have first created pivot table using pandas. saved worksheet. wrote data & formulae in worksheet using xlwt further processing. trying read value cell had written formula.
book = xlrd.open_workbook(fname) sheet = book.sheet_by_name('pivot table') print 'spare',sheet.cell(11,10).value
this code works fine , returns proper values when pointing cell without formula (that depends on other cells). cells formulae return nothing.
i need way read cell value. excel sheet has lot of formulae written , cell trying read final cell. not want back-track process value (compute through script).
i using ubuntu , have libreoffice. (fyi, in case there no direct way , need open excel , fetch data)
this can't done.
after writing excel xlwt package, need open excel , save it. opening excel file populate cells containing formulae calculated values. saving excel save these values cells along formulae.
some things observed-
- the above true cells formulae use values in other cells. if try read cells formulae '=10+2' or something, returns right value.
- after opening excel, need edit/add enable save button/option.
Comments
Post a Comment