Bug 20550 - can't read existing formula cells
Summary: can't read existing formula cells
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 2.0-pre3
Hardware: PC All
: P3 normal with 4 votes (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2003-06-06 15:20 UTC by Ethan Shayne
Modified: 2005-03-20 17:06 UTC (History)
0 users

An example of a formula-based cell that I cannot read/access - cell A1 (13.50 KB, application/octet-stream)
2003-06-06 17:00 UTC, Ethan Shayne

Note You need to log in before you can comment on or make changes to this bug.
Description Ethan Shayne 2003-06-06 15:20:05 UTC
If I open an existing Excel (2000) workbook, I can't seem to access formula-
based cells at all - HSSFRow.getCell() returns null for any cell that has a 
formula already in it.
Comment 1 Danny Mui 2003-06-06 15:55:04 UTC
When there are merged cells involved, the getCell target may be a little off. 
Please provide sample code/excel files so we can take a look at it.
Comment 2 Ethan Shayne 2003-06-06 17:00:36 UTC
Created attachment 6678 [details]
An example of a formula-based cell that I cannot read/access - cell A1
Comment 3 Ethan Shayne 2003-06-06 17:11:06 UTC
This is the code I am using to access the attached spreadsheet:

FileInputStream inputFile = new FileInputStream("c:\\temp\\test.xls");
POIFSFileSystem fileSystem = new POIFSFileSystem(inputFile);
HSSFWorkbook workbook = new HSSFWorkbook(fileSystem);
HSSFSheet spreadsheet = workbook.getSheetAt(0);
HSSFRow row = spreadsheet.getRow(0);
HSSFCell cell = row.getCell((short)0);

"cell" is coming out null.
Comment 4 Andy Oliver 2003-07-24 16:50:06 UTC
this should work.  We should fix this.
Comment 5 Eric Ladner 2003-07-26 05:03:40 UTC
I can't reproduce this with a recent stock CVS checkout.  I have a quickie
formula test program that reads the attached .xls file fine and produces this:

Formula: <B1+C1>
Raw formula = <B1 C1 + >
Printing cell references:
   (Ref) B1
       (Ref) C1

(the formula is in cell (0,0) on sheet 0.
Comment 6 Avik Sengupta 2003-10-30 17:17:09 UTC
This works, no problems at all.