https://bz.apache.org/bugzilla/show_bug.cgi?id=62433
Bug ID: 62433 Summary: POI cannot evaluate cell from workbook references if it's worksheet name contains a "#" (hash) Product: POI Version: 3.15-FINAL Hardware: PC Status: NEW Severity: normal Priority: P2 Component: XSSF Assignee: dev@poi.apache.org Reporter: cree...@gmx.de Target Milestone: --- My excelfile 'ToBeRead' contains a cell which is referencing to another excelfile 'MuchAwesome' via the formula: ='Z:\VerySecret\[MuchAwesome.xlsx]#SoWow'!A1 if I call evaluateCell with a Workbook.getCreationHelper().createFormulaEvaluator() I will be punished by an exception claiming falsely: java.lang.IllegalArgumentException: Invalid sheetIndex: -1. if I create a worksheet in my referenced Excel that is not using the "#" character like 'SoWow', all is fine, but since '#SoWow' seems to be a valid workbook name, this might be an issue? Fatal error: java.lang.IllegalArgumentException: Invalid sheetIndex: -1. org.apache.poi.ss.formula.SheetRefEvaluator.<init>(SheetRefEvaluator.java:36) org.apache.poi.ss.formula.OperationEvaluationContext.createExternSheetRefEvaluator(OperationEvaluationContext.java:136) org.apache.poi.ss.formula.OperationEvaluationContext.createExternSheetRefEvaluator(OperationEvaluationContext.java:84) org.apache.poi.ss.formula.OperationEvaluationContext.getRef3DEval(OperationEvaluationContext.java:313) org.apache.poi.ss.formula.WorkbookEvaluator.getEvalForPtg(WorkbookEvaluator.java:681) org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:552) org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:317) org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:259) org.apache.poi.xssf.usermodel.BaseXSSFFormulaEvaluator.evaluateFormulaCellValue(BaseXSSFFormulaEvaluator.java:65) org.apache.poi.ss.formula.BaseFormulaEvaluator.evaluateFormulaCellEnum(BaseFormulaEvaluator.java:193) So long, Alex. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org