Excel API Library for Java - Sample Browser | Document Solutions | Move worksheet
[
フレーム]
src="bundle.js">
Refer to the following example code to move a worksheet to the end of all worksheets.
// Create a new workbook
Workbook workbook = new Workbook();
//Load template file AgingReport.xlsx from resource
InputStream fileStream = this.getResourceStream("xlsx/AgingReport.xlsx");
workbook.open(fileStream);
//Move the active sheet to the end of current workbook
IWorksheet move_worksheet = workbook.getActiveSheet().move();
move_worksheet.setName("Move of " + workbook.getActiveSheet().getName());
// Save to an excel file
workbook.save("MoveWorksheet.xlsx");
// Create a new workbook
var workbook = Workbook()
//Load template file AgingReport.xlsx from resource
val fileStream = this.getResourceStream("xlsx/AgingReport.xlsx")
workbook.open(fileStream!!)
//Move the active sheet to the end of current workbook
val move_worksheet = workbook.activeSheet.move()
move_worksheet.name = "Move of " + workbook.activeSheet.name
// Save to an excel file
workbook.save("MoveWorksheet.xlsx")