Hi,
i have an XLS file which contains a function (macro) written in Visual
Basic. The function is named link.
This function is used as a formula in some cell. E.g =link(...).
The problem is that when HSSF reads these cells it retuns
HSSFCell.CELL_TYPE_ERROR
Any ideas?
Here is my code:
HSSFFormulaEvaluator evaluator = new
HSSFFormulaEvaluator(sheet, workbook);
CellReference cellReference = new CellReference(i, j);
HSSFRow rw = sheet.getRow(cellReference.getRow());
HSSFCell c = rw.getCell(cellReference.getCol());
evaluator.setCurrentRow(rw);
HSSFFormulaEvaluator.CellValue cellValue =
evaluator.evaluate(c);
switch (cellValue.getCellType()) {
case HSSFCell.CELL_TYPE_BOOLEAN:
System.out.println(cellValue.getBooleanValue());
break;
case HSSFCell.CELL_TYPE_NUMERIC:
System.out.println(cellValue.getNumberValue());
break;
case HSSFCell.CELL_TYPE_STRING:
System.out.println(cellValue.getRichTextStringValue());
break;
case HSSFCell.CELL_TYPE_BLANK:
System.out.println("BLANK");
break;
case HSSFCell.CELL_TYPE_ERROR:
System.out.println(" ERROR ");
break;
}
}
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]