python - How to set formula value in openpyxl -


i'm trying write simple tool work on .csv , .xlsx files. idea read in data .csv add modifications , export .xlsx modifications added. i've got working when try write out .xlsx file (using openpyxl in python) i'm having trouble. when open document in either libreoffice calc or gnumeric fields aren't showing. fields i'm having trouble include formulas. when click on them formulas correctly typed in field, nothing shown in field. if retype character in formula it's evaluated , value shows up.

i had poke around in underlying .xml of worksheet , cells doesn't have cache. noticed didn't have right data type. tried fix explicitly setting type formula no luck.

what use set cell is:

cell = ws.cell(column=i,row=j) cell.set_explicit_value(value=val,data_type=cell.type_formula) 


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -