https://issues.apache.org/bugzilla/show_bug.cgi?id=47358

           Summary: Could not resolve external workbook name. Workbook
                    environment has not been set up
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]


I'm trying to run the sample code found at the bottom of
http://poi.apache.org/spreadsheet/eval.html for re-calculating all formulas in
a workbook (I had to modify the code to the following to get it to compile).

FileInputStream fis = new FileInputStream(filename);
        FileOutputStream out = new
FileOutputStream(filename.replaceAll(".xls","temp.xls"));
        org.apache.poi.ss.usermodel.Workbook wb = new HSSFWorkbook(fis); //or
new XSSFWorkbook("/somepath/test.xls")
        FormulaEvaluator evaluator =
wb.getCreationHelper().createFormulaEvaluator();
        for(int sheetNum = 0; sheetNum < wb.getNumberOfSheets(); sheetNum++) {
            org.apache.poi.ss.usermodel.Sheet sheet = wb.getSheetAt(sheetNum);
            RoadmapGUIView.updateProgressText("Updating sheet " + 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) {
                        evaluator.evaluateFormulaCell(c);
                    }
                }
            }
        }
        wb.write(out);
        out.close();

When I run the program, I'm getting the error java.lang.RuntimeException: Could
not resolve external workbook name 'rm0509.xls'. Workbook environment has not
been set up.

rm0509.xls is a linked spreadsheet within the spreadsheet I'm trying to update.

I can't find any information on this error.

Can you help?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to