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.
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.
Created attachment 6678 [details] An example of a formula-based cell that I cannot read/access - cell A1
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.
this should work. We should fix this.
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.
This works, no problems at all.