Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JSpreadsheet
>
Tutorial
> Clone Sheet
The following example shows you how to duplicate worksheet.
import com.independentsoft.office.spreadsheet.Workbook; import com.independentsoft.office.spreadsheet.Worksheet; public class Example { public static void main(String[] args) { try { Workbook book = new Workbook("c:\\test\\input.xlsx"); Worksheet sheet1 = (Worksheet)book.getSheets().get(0); Worksheet sheet2 = sheet1; book.getSheets().add(sheet2); book.save("c:\\test\\output.xlsx", true); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*