DIAdem Help

Method: Remove for Worksheets

  • Updated2024-09-12
  • 1 minute(s) read

Method: Remove for Worksheets

Deletes a worksheet in an Excel workbook.

Object.Remove(NameOrIndex)
ObjectWorksheets
Object with this method
NameOrIndexVariant
Specifies the name or index of the worksheet.

The following example creates an Excel workbook, checks whether the Data worksheet exists, and deletes it. Refer to the help page Worksheets for detailed examples:

VBScriptPython

 

Dim oMyWorkbook, oMyWorkSheet
Set oMyWorkbook = CreateExcelWorkbook()
If oMyWorkbook.Worksheets.Exists("Data") Then
  Call  oMyWorkbook.Worksheets.Remove("Data")
End If