Apologies if this is the wrong forum to ask this kind of question. I’m not sure where else to ask. What I need to accomplish is to create a VB.NET program to interact with an .ods file, changing values of certain cells, and re-saving it as a different .ods file, and then, for the new .ods file, recompute all formula cells and retrieve the value of a specific formula cell. I think I’ve got the first part pretty much hammered out: I can unzip the .ods file and change the values set in the nodes associated with the cells in the contents.xml
file and then re-save and re-zip. The hard part, though, is the next part. I need my program to not rely on the presence of any office suite on the system, so determining the result of any formula cell after changes are made is far from trivial. Does anyone have any pointers?
You’d have to read the sheet (table/cells) structure and come up with a formula parser and interpreter that would have to handle all reference types, functions and operators that are used in the document. Specification is ODF v1.3 Recalculated Formula (OpenFormula) (ODFF), but do you really want to go down that road? Why not use a LibreOffice instance, connect against and use the UNO API for all, modifying content and have it recalculated and saved?
1 Like