Created attachment 37224 [details] xlsm file containing a macrosheet that reproduces the problem This is almost a duplicate of the fixed bug 50119 except that my xlsm contains a macro sheet. The same analysis as in 50119 applies here. In the constructor of XSSFReader.SheetIterator only worksheets and chartsheets are added to the sheetMap. The macro sheet (http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet) is not added to the sheetMap. But the iterator iterates over all valid IDs, including the macro sheet. Since the sheetMap doesn't contain the macro sheet this call in SheetIterator.next() return sheetPkg.getInputStream(); (org.apache.poi.xssf.eventusermodel.XSSFReader.SheetIterator, line 313) throws a NullPointer.
Fixed via r1877814 on trunk now.