File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes POI - how to force Excel to re-calculate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "POI - how to force Excel to re-calculate" Watch "POI - how to force Excel to re-calculate" New topic

POI - how to force Excel to re-calculate

Greg Soulsby

Joined: Feb 01, 2011
Posts: 9
Within POI I am putting a formula into cells,


But Excel it shows the result as #value. If I go into edit on the formula and hit enter, it recalcs and works fine. Forcing re-calc with an F9 or AltF9 or Ctl Alt F9 does nothing. Tried evaluator.evaluateFormulaCell(cell); within POI but that crashes, presumably LINEST and or array functions are not implemented.

So my solution has been to write an excel macro that loops through the rows and columns, pasting each cell onto itself, thus forcing recalc.

Is there a way of programatically from POI setting a cell so it is recalulated by Excel when it opens / hit f9?

Martijn Verburg

Joined: Jun 24, 2003
Posts: 3275

Hi Greg and welcome to Javaranch!

What version of POI are you using?

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
I agree. Here's the link:
subject: POI - how to force Excel to re-calculate
It's not a secret anymore!