WorksheetCollection class
WorksheetCollection class
Encapsulates a collection of Worksheet
objects.
The WorksheetCollection type exposes the following members:
Properties
Property | Description |
---|---|
web_extension_task_panes | Gets the list of task panes. |
web_extensions | Gets the list of task panes. |
threaded_comment_authors | Gets the list of threaded comment authors. |
is_refresh_all_connections | Indicates whether refresh all connections on opening file in MS Excel. |
names | Gets the collection of all the Name objects in the spreadsheet. |
active_sheet_name | Represents the name of active worksheet when the spreadsheet is opened. |
active_sheet_index | Represents the index of active worksheet when the spreadsheet is opened. |
dxfs | Gets the master differential formatting records. |
xml_maps | Gets and sets the XML maps in the workbook. |
built_in_document_properties | Returns a DocumentProperty collection that represents all the built-in document properties of the spreadsheet. |
custom_document_properties | Returns a DocumentProperty collection that represents all the custom document properties of the spreadsheet. |
ole_size | Gets and Sets displayed size when Workbook file is used as an Ole object. |
external_links | Represents external links in a workbook. |
table_styles | Gets WorksheetCollection.table_styles object. |
revision_logs | Represents revision logs. |
capacity | Gets or sets the number of elements that the array list can contain. |
Methods
Method | Description |
---|---|
get | Add API for Python Via .Net.since this[int index] is unsupported |
get | Add API for Python Via .Net.since this[string sheetName] is unsupported |
add | Adds a worksheet to the collection. |
add | Adds a worksheet to the collection. |
add | Adds a worksheet to the collection. |
register_add_in_function | Adds addin function into the workbook |
register_add_in_function | Adds addin function into the workbook |
add_copy | Adds a worksheet to the collection and copies data from an existed worksheet. |
add_copy | Adds a worksheet to the collection and copies data from an existed worksheet. |
add_copy | Copy a group of worksheets. |
get_range_by_name | Gets Range object by pre-defined name. |
get_range_by_name | Gets Range by pre-defined name or table’s name |
refresh_pivot_tables | Refreshes all the PivotTables in the Excel file. |
refresh_pivot_tables | Refreshes all the PivotTables in the Excel file. |
copy_to | Copies the entire array list to a compatible one-dimensional array list, starting at the beginning of the target array list. |
copy_to | Copies a range of elements from the array list to a compatible one-dimensional array list, starting at the specified index of the target array list. |
index_of | Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the array list that extends from the specified index to the last element. |
index_of | Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the array list that starts at the specified index and contains the specified number of elements. |
last_index_of | Searches for the specified object and returns the zero-based index of the last occurrence within the entire array list. |
last_index_of | Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the array list that extends from the first element to the specified index. |
last_index_of | Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the array list that contains the specified number of elements and ends at the specified index. |
create_range | Creates a Range object from an address of the range. |
create_union_range | Creates a Range object from an address of the range. |
get_sheet_by_code_name | Gets the worksheet by the code name. |
sort_names | Sorts the defined names. |
swap_sheet | Swaps the two sheets. |
remove_by_name | Remove a sheet by sheet name.(CELLSPYTHONNET-192) |
remove_by_index | Remove a sheet by sheet index |
remove_at | Removes the element at a specified name. |
get_named_ranges | Gets all pre-defined named ranges in the spreadsheet. |
get_named_ranges_and_tables | Gets all pre-defined named ranges in the spreadsheet. |
set_ole_size | Sets displayed size when Workbook file is used as an Ole object. |
clear_pivottables | Clears pivot tables from the spreadsheet. |
refresh_all | Refresh all pivot tables and charts with pivot source. |
binary_search | Searches the entire sorted array list for an element using the default comparer and returns the zero-based index of the element. |
Example
from aspose.cells import Workbook
workbook = Workbook()
sheets = workbook.worksheets
# Add a worksheet
sheets.add()
# Change the name of a worksheet
sheets[0].name = "First Sheet"
# Set the active sheet to the second worksheet
sheets.active_sheet_index = 1
See Also
- module
aspose.cells
- class
DocumentProperty
- class
Range
- class
Worksheet