wood burning stoves 2.0*
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
Author

POI - how to force Excel to re-calculate

Greg Soulsby
Greenhorn

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

=INDEX(LINEST(J2:S2,V$1:AE$1^{1;2}),1,1)

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?

Regards
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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.
 
 
subject: POI - how to force Excel to re-calculate