Bug 64759 - cloneSheet
Summary: cloneSheet
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 4.1.1-FINAL
Hardware: Macintosh
: P2 regression (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-21 18:44 UTC by PC
Modified: 2020-09-21 18:44 UTC (History)
0 users



Attachments
Payload file (11.41 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-09-21 18:44 UTC, PC
Details

Note You need to log in before you can comment on or make changes to this bug.
Description PC 2020-09-21 18:44:08 UTC
Created attachment 37461 [details]
Payload file

Hi,

I am using POI 4.1.1 and latest Excel format (Office 365 Excel version : 16.39). My Excel sheet has cells with some comments in it, when I try to clone this sheet it fails with following error. Can you please suggest a solution for this.

Exception in thread "main" org.apache.poi.ooxml.POIXMLException: Can't clone sheet - unknown relation type found: http://schemas.microsoft.com/office/2017/10/relationships/threadedComment
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.addRelation(XSSFWorkbook.java:696)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.cloneSheet(XSSFWorkbook.java:627)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.cloneSheet(XSSFWorkbook.java:581)
	at org.apache.poi.xssf.usermodel.XSSFWorkbook.cloneSheet(XSSFWorkbook.java:118)
	at poi.main(poi.java:14)


-----------------------------------------------------------------------------

public static void main(String[] args) throws Exception {
        Workbook workbook = WorkbookFactory.create(new FileInputStream("Sample.xlsx"));

        Sheet cloned = workbook.cloneSheet(0);

        System.out.println("Clone Successful : "+ cloned);
    }