NativeExcel for .Net Developer's Reference

IWorksheet.DeleteMethod

Deletes the worksheet from the workbook.

[Visual Basic]
SubDelete()
[C#]
voidDelete();
[C++]
voidDelete();
[JScript]
functionDelete();

Example

This example deletes the last worksheet from the workbook.

[C#]
book.Worksheets[book.Worksheets.Count].Delete(); 
[VisualBasic]
book.Worksheets(book.Worksheets.Count).Delete() 
[C++]
book->Worksheets->Item[book->Worksheets->Count]->Delete();

See Also

IWorksheet Interface | NativeExcel Namespace