Thanks for the response
I can not get the value of a formula cell only if the values are 
written to xls thru POI. If I take an existing file with formuls and 
values, then I can get the value of the formula cell. is the problem  
because of the Excel version. I think POI supports excel 97 and I am 
using Excel 2000. 
The requirement is that, I have an excel sheet with some headers and 
some formulas. I get data from the database and insert the data into 
excel sheet. But finally I have to remove all the formulas in the sheet 
keeping the calculated value as it is.
Is this possible? If not any alternative for this?

Thanks
Suma

----- Original Message -----
From: Michael Zalewski <[EMAIL PROTECTED]>
Date: Wednesday, December 17, 2003 11:02 am
Subject: RE: How to get the value of a formula cell?

> You can't do that with POI. If the cell contains a formula, you 
> can only get
> the formula out.
> 
> You must let Excel do the calculation. Excel does this 
> automatically when
> the spreadsheet is opened. That's why opening and saving with 
> Excel, then
> looking at the cell with POI yields the correct result.
> 
> The idea here is that if you build a spreadsheet, you know what 
> numbers you
> put into C1 and C2, and can easily add them in your program.
> 
> Or, if you are processing an uploaded spreadsheet, you can read 
> the values
> of C1 and C2, then add them in your program.
> 
> POI does not, and perhaps never will, interpret or execute the 
> formulas you
> put into the spreadsheet.
> 
> -----Original Message-----
> From: Suma G Shanthappa [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 16, 2003 4:16 AM
> To: POI Users List
> Subject: How to get the value of a formula cell?
> 
> 
> I have a sheet with formula for cell C3. formula is sum(c1:c2)
> I insert values to c1 and c2. If I try to get the value of C3 I 
> get 0.0
> How do I get the value of c3 cell? Even if i save all the data and 
> thentry to open the file and try reading the value of c3 cell I 
> get 0.0
> But if I do save as and save the file with a diff name and try to read
> the value of c3 cell, I get the correct value?
> 
> Any Idea how to retrieve the value of a formula cell from the same 
> fileto which the data is stored to?
> 
> Thanks
> Suma
> 
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -------------------------------------------------------------------
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to