-2

I have two workbooks and each contains one sheet in it. Now I want to combine these two worksheets to one workbook as two sheets using POI and java .

Can anyone tell me how to do this ?

pcjuzer
  • 2,724
  • 4
  • 25
  • 34

1 Answers1

-2

you can do it using a library named "aspose"

    Workbook sheet1= new Workbook("file1.xlsx");
    Workbook sheet2= new Workbook("file2.xlsx");
 sheet1.combine(sheet2);
sheet1.save("mergedFile.xlsx");

And add this dependency into your pom

 <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-cells</artifactId>
    </dependency>
amani92
  • 903
  • 8
  • 22