Bug 47855 - java.lang.RuntimeException: Shared Formula Conversion: Coding Error
Summary: java.lang.RuntimeException: Shared Formula Conversion: Coding Error
Status: RESOLVED DUPLICATE of bug 47747
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: unspecified
Hardware: PC Windows Vista
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on: 47747
  Show dependency tree
Reported: 2009-09-16 17:33 UTC by kevinrmckee
Modified: 2009-09-16 20:11 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description kevinrmckee 2009-09-16 17:33:18 UTC
+++ This bug was initially created as a clone of Bug #47747 +++

since nobody in the community will respond to my comments in bug 47747, perhaps a new bug entry will warrant a reply?

Created an attachment (id=24176)
This zip contains the original and processed spreadsheets.

I have tried version 3.5, 3.6 and 3.7.

When trying to run the following code to go through a spreadsheet and update
the formula values, I get several errors (java.lang.RuntimeException: Shared
Formula Conversion: Coding Error).  When I open the newly created spreadsheet,
several cells have #REF issues.  I will attach the original and processed

public static void RecalculateFormulas(String filename) throws
FileNotFoundException, IOException
    {   try{
        FileInputStream fis = new FileInputStream(filename);
        FileOutputStream out = new
        HSSFWorkbook wb = new HSSFWorkbook(fis); //or new
        FormulaEvaluator evaluator =
        for(int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) {
            org.apache.poi.ss.usermodel.Sheet sheet = wb.getSheetAt(sheetNum);
            for(org.apache.poi.ss.usermodel.Row r : sheet) {
                for(org.apache.poi.ss.usermodel.Cell c : r) {
                    if(c.getCellType() ==
org.apache.poi.ss.usermodel.Cell.CELL_TYPE_FORMULA) {
                        catch(Exception e)
        catch(Exception e)
Comment 1 David Fisher 2009-09-16 20:11:01 UTC
I don't think you will help your cause by duplicating an issue. The original issue and offered patch was less than three weeks ago.

You might have noticed if you are subscribed to the dev list that core developers are applying patches in the last week. I think you would do better by asking a question as an email on the dev list.


*** This bug has been marked as a duplicate of bug 47747 ***