Created attachment 35410 [details] Example Excel file Hi, guys. I use POI 3.16 When I clone a sheet that contains hyperlinks, I get an error message: java.lang.IllegalStateException: The hyperlink for cell B5 references relation rId1, but that didn't exist! at org.apache.poi.xssf.usermodel.XSSFHyperlink.<init>(XSSFHyperlink.java:71) at org.apache.poi.xssf.usermodel.XSSFSheet.initHyperlinks(XSSFSheet.java:254) at org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:207) at org.apache.poi.xssf.usermodel.XSSFWorkbook.cloneSheet(XSSFWorkbook.java) My code: XSSFWorkbook template_wb; XSSFSheet template_sh = null, source_sh = null; //get Excel file as Blob from Oracle database Blob lBlob = GetExcelTemplateAsBlob( PNHTemplateId, ExcelTemplateName ); lBlobStream = lBlob.getBinaryStream(); template_wb = new XSSFWorkbook( lBlobStream ); template_sh = template_wb.getSheetAt( 0 ); source_sh = template_wb.cloneSheet( 0 ); <- here I get an error If the sheet does not contain hyperlinks, then all is successful. Example of a file in an attachment. Best regards. Mike
I tried to reproduce this with latest POI (4.0.1) but could not, so this is likely fixed in the meantime.