B4J Question jPOI Question - Formula Value not changing

paragkini

Member
Licensed User
Longtime User
I have one sheet with two columns (A and B) and third column (C) is sum of these two columns.
When I read the values and print logs, its printing correctly. (first I struggled with printing value for a formula cell, but did it with checking Poi.CellType using select case.
Now when I am changing the value from B4J, their sum is not updated in column C. Also after saving the sheet / book and opening in excel, updated values are visible in A and B but C shows old formula value. When I refresh (F9) in excel, value is updated in sheet.

Question : How do I refresh formula cell value in C at B4J runtime?

Thanks in advance.
 

paragkini

Member
Licensed User
Longtime User
You can force Excel to refresh the workbook by calling this method before you save the file:
B4X:
Dim jo As JavaObject = Workbook1
jo.RunMethod("setForceFormulaRecalculation", Array (True))

Works perfectly fine... thanks a lot...
 
Upvote 0
Top