|
To conserve space, Excel will only include cells if they're not empty. The
empty cells are not saved to the file.
Therefore, you may get this error when trying to update a cell that's
empty in your spreadsheet. I suggest that you check it by coding
something like the following (untested):
cell = HSSFRow_getCell(row: 85);
if cell = *NULL;
cell = HSSFRow_createCell(row: 85);
endif;
Good luck
After calling getCell() make sure you check to see if the cell object is
*NULL. That'll mean that there's no cell in that particular column of
that particular row (it shows up as an empty cell on the screen in
Excel, but it's not actually stored in the file, because it'd waste disk
space storing empty cells).
If you get a *NULL, it means that there'snothing there. You can add a
new cell using HSSFRow_CreateCell(), or my hssf_text(), hssf_num(), etc
shortcuts if you want to add a cell at that position.
If you're only trying to read existing cells, it should be safe to skip
anything that's *NULL.
If you try to refer to the cell object after it returns *NULL, you'll
end up crashing the JVM.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.