Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to combine two excel workbooks using poi?

I have to HSSFWorkbook objects, each of them contains one or more HSSFSheet. How can I get one workbook with sheets from both of these objects? POI 3.6

like image 268
Alex Korotkikh Avatar asked Nov 05 '22 02:11

Alex Korotkikh


1 Answers

There are two code examples on the below thread - one of them is fully working as per comments, but I havent tried this one myself yet. Note, it's an old link, so the API might not match Poi 3.6

http://www.coderanch.com/t/420958/open-source/Copying-sheet-excel-file-another

Create a new Workbook and copy over sheets from both existing workbooks using the above

like image 142
JoseK Avatar answered Nov 09 '22 08:11

JoseK