Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

POI - how to force Excel to re-calculate

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Greg and welcome to Javaranch!

What version of POI are you using?
 
I'm still in control here. LOOK at this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!