NativeExcel for .Net Developer's Reference

IWorksheet Interface

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]
PublicInterfaceIWorksheet
[C#]
publicinterfaceIWorksheet
[C++]
public__gc__interfaceIWorksheet
[JScript]
publicinterfaceIWorksheet

Remarks

Use the IWorksheets.Add method to create new worksheet.

Use the IWorksheets.Item property to return an IWorksheet instance.

Example

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";
[VisualBasic]
'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";

Requirements

Namespace: NativeExcel

Assembly: NativeExcel (in NativeExcel.dll)

See Also

IWorksheet Members | NativeExcel Namespace | Item