I'm playing with POI HSSF and I'm using the jakarta-poi-1.9.0-dev-20030122 version instead of release 1.5.1 because I need formulas support. I've experimented some problems setting reference string in a newly created HSSFName. Querying your Bugzilla I found other similar issues. The problem I had is just described in bug 16411. But the "answer" was in bug 16315 description. The actual behaviour is the following: A reference like sheetName!$B$2:$E$6 appear to be wrongly parsed. Instead sheetName.$B$2:$E$6 works. I append a chunk of code illustrating these issues HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("MySheet"); HSSFName name = wb.createName(); name.setNameName("MyArea"); name.setReference("MySheet!$B$2:$E$6"); System.out.println(name.getReference()); // System.out.println(name.getSheetName()); // This line would produce NullPointerException name.setReference("MySheet.$B$2:$E$6"); System.out.println(name.getReference()); System.out.println(name.getSheetName()); The output of this chunk is null!$IU$2:$E$6 MySheet!$B$2:$E$6 MySheet
Addressed in patch: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16557 *** This bug has been marked as a duplicate of 16315 ***