(HSSF API)Trouble reading changed Formula Cell values

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

(HSSF API)Trouble reading changed Formula Cell values

Tewari,kuldeep
Hi,

I am using 'org.apache.poi.hssf.usermodel' package to read an excel file
containing formulas.While reading the file,I change the values of some
Numeric cells(on which certain formulas are based in the original excel
file) and write all the values in to a new excel file,Using
HSSFWorkbook.write() function.
But when I  print the cell values by reading the newly created excel file, I
get the changed values only for the numeric cells that I changed
earlier.Formula cells retain their old values,but when I open that excel
file it shows the formula cell values are changed correctly.
Has it something to do with 'how and when' the formulas are calculated in
the MS Excel.(when I close the newly created excel file it opens a dialog
box with message "Do you want to save the changes you made in
'tempFile.xls'. Microsoft Excel recalculates the formulas when opening files
last saved by an earlier version of excel" .If I click 'yes' button and
again try to read that excel only then it gives me correct cell values.)  

Please throw some light in this issue,so that I can get through.
Thanks and regards.

Kuldeep.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/

Reply | Threaded
Open this post in threaded view
|

RE: (HSSF API)Trouble reading changed Formula Cell values

ROLLIN F         GssiItsRet
Hi Kuldeep,

POI is only a Excel file formater, it's not a Excel engine.
All formulas are calculated when Excel open the file... not before

To resolve this problem, I use an external VB program to open/save my generated file.
It's a bad solution... but it's works

Regards

ROLF

-----Message d'origine-----
De : Tewari,kuldeep [mailto:[hidden email]]
Envoyé : mercredi 1 juin 2005 08:25
À : [hidden email]
Objet : (HSSF API)Trouble reading changed Formula Cell values


Hi,

I am using 'org.apache.poi.hssf.usermodel' package to read an excel file
containing formulas.While reading the file,I change the values of some
Numeric cells(on which certain formulas are based in the original excel
file) and write all the values in to a new excel file,Using
HSSFWorkbook.write() function.
But when I  print the cell values by reading the newly created excel file, I
get the changed values only for the numeric cells that I changed
earlier.Formula cells retain their old values,but when I open that excel
file it shows the formula cell values are changed correctly.
Has it something to do with 'how and when' the formulas are calculated in
the MS Excel.(when I close the newly created excel file it opens a dialog
box with message "Do you want to save the changes you made in
'tempFile.xls'. Microsoft Excel recalculates the formulas when opening files
last saved by an earlier version of excel" .If I click 'yes' button and
again try to read that excel only then it gives me correct cell values.)  
Please throw some light in this issue,so that I can get through.
Thanks and regards.

Kuldeep.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/



=======================================================

Ce message et toutes les pieces jointes (ci-apres le "message")
sont confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
La SOCIETE GENERALE et ses filiales declinent toute responsabilite
au titre de ce message s'il a ete altere, deforme ou falsifie.
                               
=======================================================

This message and any attachments (the "message") are confidential
and intended solely for the addressees.
Any unauthorized use or dissemination is prohibited.
E-mails are susceptible to alteration.  
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates
shall be liable for the message if altered, changed or falsified.

=======================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/