Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Table of Contents
Microsoft Excel allows multiple sheets in a single file. The HTML5 Spreadsheet Editor allows the user to add and remove sheets. On the Sheets tab we have a drop‑down list of sheets. The selected sheet is the one that is opened by the editor.
To add a new sheet:
A new sheet will be added and the editor will switch to it.
To remove the currently selected sheet:
The currently selected sheet will be removed and the editor will switch to the last selected one.

How it works
When the user clicks the + (plus) or - (minus) button, the JSF backend bean WorksheetView handles the events using WorksheetView.onAddNewSheet and WorksheetView.onRemoveActiveSheet methods.
public void onAddNewSheet() {
if (isLoaded()) {
try {
int i = getAsposeWorksheets().add();
getAsposeWorksheets().setActiveSheetIndex(i);
purge();
} catch (com.aspose.cells.CellsException cx) {
msg.sendMessage("New Worksheet", cx.getMessage());
}
}
} public void onRemoveActiveSheet() {
if (isLoaded()) {
try {
int i = getAsposeWorksheets().getActiveSheetIndex();
getAsposeWorksheets().removeAt(i);
if (getAsposeWorksheets().getCount() == 0) {
int j = getAsposeWorksheets().add();
getAsposeWorksheets().setActiveSheetIndex(j);
}
purge();
} catch (com.aspose.cells.CellsException cx) {
msg.sendMessage("Could not remove sheet", cx.getMessage());
}
}
}To rename a sheet:
The sheet will be renamed.

How it works
When the text box value is changed, the event is handled on the server by the JSF backend bean WorksheetView using the method WorksheetView.setActiveSheet.
public void setActiveSheet(String name) {
com.aspose.cells.Worksheet w = getAsposeWorksheets().get(name);
if (w != null) {
int i = w.getIndex();
getAsposeWorksheets().setActiveSheetIndex(i);
} else {
getAsposeWorksheet().setName(name);
}
purge();
}To switch to another sheet:
The editor will switch to the selected sheet.

How it works
When the drop‑down selector’s value is changed, the event is handled on the server by the JSF backend bean WorksheetView using the method WorksheetView.setActiveSheet.
public void setActiveSheet(String name) {
com.aspose.cells.Worksheet w = getAsposeWorksheets().get(name);
if (w != null) {
int i = w.getIndex();
getAsposeWorksheets().setActiveSheetIndex(i);
} else {
getAsposeWorksheet().setName(name);
}
purge();
}Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.