You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Alex Vb <i8...@gmail.com> on 2012/05/11 11:36:48 UTC

RuntimeException when external excel not found

When evaluating a formula in a cell, I got a runtime exception with the
following (partial) stacktrace:

    at
org.apache.poi.ss.formula.OperationEvaluationContext.createExternSheetRefEvaluator(OperationEvaluationContext.java:89)
    at
org.apache.poi.ss.formula.OperationEvaluationContext.getRef3DEval(OperationEvaluationContext.java:249)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.getEvalForPtg(WorkbookEvaluator.java:607)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:493)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:287)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:229)
    at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCellValue(HSSFFormulaEvaluator.java:354)
    at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluate(HSSFFormulaEvaluator.java:185)

It seems the class org.apache.poi.ss.formula.OperationEvaluationContext
throws a runtime exception if an external workbook is not found. Is there a
reason for this design decision?

I would suggest:
- a formula error (e.g. "#REF")
- or a checked exception
- or if all else fails, an unchecked exception but a subtype so we don't
have to catch RuntimeException and a mention of this behavior in the
javadocs because until it occurred I had no idea this behavior was expected

Controlling text extraction from XLS files

Posted by Chris Bamford <cb...@mimecast.com>.
Hi there,

I have been reading with interest the docs on processing Excel documents.
In particular I am interested in text extraction for which I am currently using Aperture
1.6.0 which includes POI 3.8-beta5.  

I would like to know how to fine tune the process because in addition to expected text 
(column titles, workbook names, etc.), it also extracts a lot of floating point numbers 
which bear no visible relation to the numbers in the cells.  I can only think that perhaps
they are dates (or similar) in an internal format?
Anyway, for my application they are unwanted and need to be suppressed somehow.

Could someone kindly point me in the right direction?

Thanks,

- Chris


Chris Bamford
Senior Developer

2 - 8 Balfe Street
Kings Cross,
London, N1 9EG

mobile +44 7860 405292
tel: +44 (0) 207 843 2300
web www.mimecast.com


The information contained in this communication from cbamford@mimecast.com is confidential and may be legally privileged. It is intended solely for use by dev@poi.apache.org and others authorized to receive it. If you are not dev@poi.apache.org you are hereby notified that any disclosure, copying, distribution or taking action in reliance of the contents of this information is strictly prohibited and may be unlawful.


Mimecast Ltd. is a company registered in England and Wales with the company number 4698693 VAT No. GB 123 4197 34
Registered Office:2 - 8 Balfe Street, Kings Cross London, N1 9EG Email Address: info@mimecast.com

This email message has been scanned for viruses by Mimecast.
Mimecast delivers a complete managed email solution from a single web based platform.
For more information please visit http://www.mimecast.com