Hello,
I try to evaluate the value of the formulas contained in my Workbook
"main.xlsx".
In these formulas, I have references to an external xlsx file ("test.xlsx").
When I try to run the method "evaluateAllFormulaCells(wbMain)", I get the
error: "Could not resolve external workbook name 'test.xlsx'. Workbook
environment has not been set up".
So I try to set up the environment like this:
> //Defining my elements
> String nameWbMain = "main.xlsx";
> String nameWbTest = "test.xlsx";
> XSSFWorkbook wbMain = new XSSFWorkbook(new FileInputStream(nameWbMain));
> XSSFWorkbook wbTest = new XSSFWorkbook(new FileInputStream(nameWbTest));
> XSSFFormulaEvaluator feMain = new XSSFFormulaEvaluator(wbMain);
> XSSFFormulaEvaluator feTest = new XSSFFormulaEvaluator(wbTest);
>
> //Trying to set up my environment
> Map
> <
> String, FormulaEvaluator
> >
> mapFe = new Hashtable
> <
> String, FormulaEvaluator
> >
> ();
> mapFe.put(nameWbTest, feTest);
> feMain.setupReferencesWorkbooks(mapFe);
>
> //Trying to evaluate the formulas
> feMain.evaluateAll();
But I get the same error message (environment not set up).
I am certainly doing something wrong but I can't figure out what.
Patrick
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/Setting-up-workbook-environment-XSSFFormulaEvaluator-tp5717305.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]