WorksheetCollection

WorksheetCollection

Overview

WorksheetCollection is a class in Aspose.Cells FOSS for C++.

Encapsulates the workbook’s worksheets and active-sheet state.

This class provides 13 methods for working with WorksheetCollection objects in C++ programs. Available methods include: Add, GetActiveSheetIndex, GetActiveSheetName, GetCount, RemoveAt, SetActiveSheetIndex, SetActiveSheetName, WorksheetCollection, begin, end. All public members are accessible to any C++ application after installing the Aspose.Cells FOSS for C++ package. Accessor methods: WorksheetCollection.

Accessor Methods

NameTypeAccessDescription
WorksheetCollectionWorksheetCollectionReadGets the worksheet collection.

Methods

SignatureDescription
WorksheetCollection()WorksheetCollectionCalls WorksheetCollection on this WorksheetCollection instance.
WorksheetCollection()
GetCount()intGets the total number of worksheets in the workbook.
GetActiveSheetIndex()intGets or sets the zero-based index of the active worksheet.
SetActiveSheetIndex(value: int)Sets the active sheet index value.
GetActiveSheetName()std::stringGets or sets the name of the active worksheet.
SetActiveSheetName(value: std::string_view)Sets the active sheet name value.
Add()intAdds a worksheet using the next generated default name. The zero-based index of the added worksheet.
Add(sheetName: std::string_view)intAdds a worksheet with the specified name and returns its index. The name of the new worksheet. The zero-based index of the added worksheet.
RemoveAt(index: int)Removes the worksheet at the specified zero-based index. The zero-based index of the worksheet to remove.
RemoveAt(sheetName: std::string_view)Removes the worksheet with the specified name. The name of the worksheet to remove.
begin()std::vector<std::unique_ptr<Worksheet>>::const_iteratorReturns an iterator to the beginning of the worksheet collection.
end()std::vector<std::unique_ptr<Worksheet>>::const_iteratorReturns an iterator to the end of the worksheet collection.

See Also

 English