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]


Use the IWorksheets.Add method to create new worksheet.

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


This example creates new worksheet.

//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";
'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"
//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)

See Also

IWorksheet Members | NativeExcel Namespace | Item