On Mon, 18 Jul 2011, Tomasek, Kevin wrote:
I have an instance of where the call getNumericCellValue is failing
because it thinks that the cell value is null. I can see in the
debugger (eclipse) that the cell type is indeed 0 (zero), which means
numeric, and the cell in question is not null, the record value is not
null, but the program consistently fails at the same place.
The spreadsheet is an .xls file that 4 rows x 10 columns. The program
itself is 80 +/- lines long. The getStringCellValue works perfectly
fine on the remainder of the spreadsheet.
Can you try running BiffViewer[1] against the file, and see what that
shows for the problem cell? You'll need to find the section of records for
the sheet in question (easy if you only have one sheet!), then look for
the record for your porblem cell.
For example, this is the output for cell B2 which is a string:
Offset=0x0000310F(12559) recno=322 sid=0x00FD size=0x000A(10)
[LABELSST]
.row = 0x0001
.col = 0x0001
.xfindex= 0x000F
.sstIndex = 0x000F
[/LABELSST]
What does your file show up as?
The second check is to see what the Microsoft Binary File Format
Validator[2] thinks of your file? Does it consider your Excel file to be
valid, or does it identify a fault with the file itself?
Nick
[1] org.apache.poi.hssf.dev.BiffViewer
[2]
http://blogs.msdn.com/b/officeinteroperability/archive/2011/07/12/microsoft-office-binary-file-format-validator-is-now-available.aspx
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]