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"];
Imports DevExpress.Spreadsheet ' ... Dim workbook As IWorkbook = spreadsheetControl1.Document ' Access a collection of worksheets. Dim worksheets As WorksheetCollection = workbook.Worksheets ' Access a worksheet by its index. Dim worksheet1 As Worksheet = workbook.Worksheets(0) ' Access a worksheet by its name. Dim worksheet2 As Worksheet = workbook.Worksheets("Sheet2")