Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.Cells provides a class, Workbook that represents an Excel file. The Workbook class contains a worksheets collection that allows access to each worksheet in the Excel file.
A worksheet is represented by the Worksheet class. The Worksheet class provides a wide range of properties and methods for managing worksheets.
To create a new Excel file programmatically:
The process of adding worksheets to a designer spreadsheet is the same as that of adding a new worksheet, except that the Excel file already exists, so it should be opened before worksheets are added. A designer spreadsheet can be opened by the Workbook class.
Access any worksheet by specifying its name or index.
To remove worksheets from a file, call the remove_by_name method of the WorksheetCollection class. Pass the sheet name to the remove_by_name method to remove a specific worksheet.
Removing worksheets by name works well when the name of the worksheet is known. If you don’t know the worksheet’s name, use the remove_by_index method that takes the sheet index of the worksheet instead of its sheet name.
Sometimes, you need a specific worksheet to be active and displayed when a user opens a Microsoft Excel file in Excel. Similarly, you might want to activate a specific cell and set the scrollbars to show the active cell. Aspose.Cells is capable of doing all these tasks.
An active sheet is a sheet you’re working on: the active sheet’s name on the tab is bold by default.
An active cell is a selected cell, the cell into which data is entered when you begin typing. Only one cell is active at a time. The active cell is highlighted by a heavy border.
Aspose.Cells provides specific API calls for activating a sheet and a cell. For example, the Aspose.Cells.WorksheetCollection.active_sheet_index property is useful for setting the active sheet in a workbook. Similarly, the Aspose.Cells.Worksheet.active_cell property is used to set and get the active cell in the worksheet.
To ensure that the horizontal or vertical scrollbars are positioned at the desired row and column indices, use the Aspose.Cells.Worksheet.first_visible_row and Aspose.Cells.Worksheet.first_visible_column properties.
The following example shows how to activate a worksheet and make a cell active in it. In the generated output, the scrollbars will be scrolled to make the 2nd row and 2nd column the first visible row and column.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.