public interface WorksheetCollection : ISimpleCollection<Worksheet>, IEnumerable<Worksheet>, IEnumerable, ICollection
Public Interface WorksheetCollection Inherits ISimpleCollection(Of Worksheet), IEnumerable(Of Worksheet), IEnumerable, ICollection
Related API Members
The following members accept/return WorksheetCollection objects:
The WorksheetCollection object stores worksheets of the workbook (a workbook always contains at least one worksheet). Use the IWorkbook.Worksheets property to access this object. The WorksheetCollection.Item property enables you to get an individual worksheet by its name or index in the collection.
To add a new worksheet to the workbook, use the WorksheetCollection.Add or WorksheetCollection.Insert method. To remove a worksheet from the workbook, use the WorksheetCollection.Remove or WorksheetCollection.RemoveAt method.
For details on how to manage worksheets in a workbook, refer to the Worksheets section of examples.
To get an individual worksheet by its index or name, use the WorksheetCollection.Item property.
using DevExpress.Spreadsheet; // ... IWorkbook workbook = spreadsheetControl1.Document; // Access a collection of worksheets. WorksheetCollection worksheets = workbook.Worksheets; // Access a worksheet by its index. Worksheet worksheet1 = workbook.Worksheets; // Access a worksheet by its name. Worksheet worksheet2 = workbook.Worksheets["Sheet2"];