Represents a worksheet. The IWorksheet interface is a member of the Worksheets collection. The Worksheets collection contains all the IWorksheet interfaces in a workbook.
For a list of all members of this type, see IWorksheet Members.
[Visual Basic] Public Interface IWorksheet [C#] public interface IWorksheet [C++] public __gc __interface IWorksheet [JScript] public interface IWorksheet
Use the IWorksheets.Add method to create new worksheet.
Use the IWorksheets.Item property to return an IWorksheet instance.
This example creates new worksheet.
[C#]
//Create new workbook
IWorkbook book = NativeExcel.Factory.CreateWorkbook();
//Create a worksheet
IWorksheet sheet = book.Worksheets.Add();
//Change name of the worksheet
sheet.Name = "NewSheet";
//Set the value of the cell A1
sheet.Cells[1,1].Value = "Text Value";
[Visual Basic]
'Create new workbook
Dim book As IWorkbook = NativeExcel.Factory.CreateWorkbook()
'Create a worksheet
Dim sheet As IWorksheet = book.Worksheets.Add()
'Change name of the worksheet
sheet.Name = "NewSheet"
'Set the value of the cell A1
sheet.Cells(1,1).Value = "Text Value"
[C++]
//Create new workbook
IWorkbook* book = NativeExcel::Factory::CreateWorkbook();
//Create a worksheet
IWorksheet* sheet = book->Worksheets->Add();
//Change name of the worksheet
sheet->Name = S"NewSheet";
//Set the value of the cell A1
sheet->Cells->Item[1,1]->Value = S"Text Value";
Namespace: NativeExcel
Assembly: NativeExcel (in NativeExcel.dll)
IWorksheet Members | NativeExcel Namespace | Item