Method: RemoveAll for Worksheets
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: RemoveAll for Worksheets
Method: RemoveAll for Worksheets
Deletes all worksheets of an Excel workbook.
Object.RemoveAll
| Object | Worksheets Object with this method |
The following example creates an Excel workbook, deletes all the worksheets, and creates a new worksheet named Data. Refer to the help page Worksheets for detailed examples:
| VBScript | Python |
Dim oMyWorkbook, oMyWorkSheet Set oMyWorkbook = CreateExcelWorkbook() Call oMyWorkbook.Worksheets.RemoveAll Set oMyWorkSheet = oMyWorkbook.Worksheets.Add("Data")