The formulaparser fails when text contains no alpha characters (e.g) giving the argument "(" & F3 & ")" throws an exception. The code in org.apache.poi.hssf.model.FormulaParser.StringLiteral() executes the method GetNameAsIs() which in turn calls isAlpha() that only allows for alphabetic characters which of course is to limited for a formula like the above.
Can you provide the snippet of code to duplicate this (ie a testcase)? Can you also provide the Excel use for such a formula (for people that aren't 100% experts in Excel). Thanks
Example String currencyCell = "F3"; HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet(quote.getName()); HSSFRow row = sheet.createRow((short) 0); HSSFCell cell = row.createCell((short) 0); cell.setCellFormula("\"TOTAL[\" & " + currencyCell + " & \"]\""); In this case I had a request to create a spreadsheet, that in cell F3 would contain a currency (by the user typing it), and several other cells would use that value to display a heading e.g. typing USD in cell F3 would display "Total [USD]" in cell A1.(obviously the requirement of the square brackets could be relaxed).
Resolved in nightly build as of March 17, 2003 Thanks for the bug report!