Bug 36941

Summary: HSSFCell.getCellFormula() returns "NO IDEA SHARED FORMULA EXP PTG"
Product: POI Reporter: Andreas Korthaus <akorthaus>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: P2    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: the Excel File causing the problem
Java code for reading the formula

Description Andreas Korthaus 2005-10-05 22:36:43 UTC
I have an Excel file with some formulas, some of them return "NO IDEA SHARED
FORMULA EXP PTG" when I use:

HSSFCell.getCellFormula()

I have found some postings and some bugs with similar issues, some seem to
fixed, some not. Seems to have something to do with "shared formulas". Since I
use the latest version of POI (poi-3.0-alpha1-20050704.jar) and I don't know if
it's the same issue, I opened a new bug to attatch my excel sheet causing the
problems. I cannot reproduce such a "problematic" excel sheet by myself, it
comes from someone else.

If I change the values of some cells in the sheet, that's not a problem. I also
can copy the cells to an other spreadsheet or workbook - the problem "survives".

Only if I remove a complete row or a complete column before (in Excel!), the
formulas suddenly appear when I try to read them using HSSFCell.getCellFormula().

You can find the problematic cells / formulas in G59:G64

I also attatched a (very) simple java class for testing.

Some other Bugs/Postings talk about similar problems and patches for it, but I
can't find a POI version where these patches are applied, or it must be a
different problem.

I don't understand how people can use Formula Reading from POI, the error
happend with the latest version of POI and with the third Excel file I ever tested!
Comment 1 Andreas Korthaus 2005-10-05 22:41:10 UTC
Created attachment 16601 [details]
the Excel File causing the problem

try to read formulas from G59:G64 using HSSFCell.getCellFormula() 

You can use the Java file from second attatchement as a "draft"
Comment 2 Andreas Korthaus 2005-10-05 22:43:07 UTC
Created attachment 16602 [details]
Java code for reading the formula
Comment 3 Trejkaz (pen name) 2006-07-12 02:48:25 UTC

*** This bug has been marked as a duplicate of 20321 ***