NativeExcel2 for .Net Developer's Reference

IWorkbook Interface

Represents a Microsoft Excel workbook

For a list of all members of this type, see IWorkbook Members.

[Visual Basic]
PublicInterfaceIWorkbook
[C#]
publicinterfaceIWorkbook
[C++]
public__gc__interfaceIWorkbook
[JScript]
publicinterfaceIWorkbook

Example

This example creates new workbook and saves it into C:\book.xls

[C#]
IWorkbook book = Factory.CreateWorkbook();
IWorksheet sheet = book.Worksheets.Add();
sheet.Name = "Sheet1";
book.SaveAs("C:\\book.xls");
[VisualBasic]
Dim book As IWorkbook = Factory.CreateWorkbook()
Dim sheet As IWorksheet
sheet  = book.Worksheets.Add()
sheet.Name = "Sheet1"
book.SaveAs("book.xls")
[C++]
IWorkbook* book = Factory::CreateWorkbook();
IWorksheet* sheet = book->Worksheets->Add();
sheet->Name = S"Sheet1";
book->SaveAs(S"book.xls");

Requirements

Namespace: NativeExcel

Assembly: NativeExcel (in NativeExcel.dll)

See Also

IWorkbook Members | NativeExcel Namespace | Factory