It might be possible for the workbook to store formula evaluation state so you can switch between EVALUATE_BLANK_CELLS_AS_ZERO (Excel behavior) and EVALUATE_BLANK_CELLS_AS_NULL. Alternatively, internal state might be avoidable if the call to evaluate the cell specifies the desired behavior, though I'd need to read the code to see if that's doable without editing tons of functions or constructors.
Sounds like you have an ugly workaround, though it has some negative consequences: * Unnecessarily editing formulas * Storing temporary formulas in workbook * HSSFWorkbook has a limit 8 nested functions. By adding a nested function, you may exceed that (make sure POI returns the formula the original formula so Excel doesn't balk) * evaluates essentially the same expression twice. Might be expensive depending on the function. * potential unknown (such as User-Defined VBA functions) evaluations. For your application, you're evaluating the formula anyway, so it might not be a big deal. I'm not sure if this causes any problems for the rest of the evaluation chain. On Dec 11, 2015 11:44 PM, "Mark Beardsley" <markbrd...@tiscali.co.uk> wrote: > Morning Philipp > > Thanks for letting us know that you found a solution - and what that was as > it may well help someone else out in the future. I would say that not > changing the core api is the better option as it means you do not have to > modify any future releases of POI that you may download. > > Any further problems or issues, just post here and someone will try to help > out. > > > > -- > View this message in context: > http://apache-poi.1045710.n5.nabble.com/Import-Excel-How-to-get-a-blank-when-the-result-of-a-formula-is-blank-tp5721160p5721272.html > Sent from the POI - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@poi.apache.org > For additional commands, e-mail: user-h...@poi.apache.org > >