-
JXL Empty cell problem
Hello, i recently posted about a problem calling an excel document but was able to figure it out with a friend, Now my problem is being able to tell a for statement to stop going down a column of cells once it reaches the end of the contents,(or an empty cell). I've tried using these codes.
for(int i = 0; sheet.getCell(0,i).getContents() != ""; i++)
for(int i = 0; sheet.getCell(0,i).getContents() != null; i++)
for(int i = 0; sheet.getCell(0,i).getType()!= CellType.EMPTY; i++)
for(int i = 0; sheet.getCell(0,i).getCellFormat()!= null; i++)
Each of these codes have given an out of bounds exception
any ideas on What i might try next?
-
Catch the exception, then break the for.