How to Delete Worksheets from Excel - Remove Sheets from Workbooks
Programmatically delete worksheets from Excel workbooks using Aspose.Cells Cloud API. Safely remove single or multiple sheets, clean up workbook structure, and automate spreadsheet optimization. RESTful API for enterprise‑grade Excel management and document‑processing workflows.
Delete worksheet from Spreadsheet API
Web API
PUT "https://api.aspose.cloud/v4.0/cells/spreadsheet/delete/worksheet?sheetName={sheetName}&outPath={outPath}&outStorageName={outStorageName}®ion={region}&password={password}"
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request Parameters:
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Spreadsheet | File | FormData | Required. The source Excel workbook file (.xlsx, .xls, etc.) from which a worksheet will be removed. |
| sheetName | String | Query | Required. The exact name of the worksheet to be deleted (e.g., Sheet1, TemporaryData). |
| outPath | String | Query | Optional. The target folder path in cloud storage where the modified workbook will be saved. If omitted or null, the workbook is saved in the same location as the source file or a default path. |
| outStorageName | String | Query | Optional. The identifier of the cloud storage service (e.g., ProjectStorage) where the output file will be written. If not supplied, the default storage is used. |
| region | String | Query | Optional. The locale setting (e.g., it-IT) that may affect region‑specific formulas or data during the save operation. |
| password | String | Query | Optional. The password required to open and modify a password‑protected spreadsheet. Omit if the file is not encrypted. |
Response
[
{
"Name": "ResponseFile",
"DataType": {
"Identifier": "File",
"Reference": "Stream"
}
}
]
HTTP Status Codes
| Code | Meaning | Description |
|---|---|---|
| 200 | OK | Filter applied successfully; response contains operation details. |
| 400 | Bad Request | Missing or invalid parameters (e.g., unsupported file type). |
| 401 | Unauthorized | Invalid or missing JWT token. |
| 413 | Payload Too Large | Uploaded file exceeds size limit. |
| 500 | Internal Server Error | Unexpected server error. |
Where should we use the Delete worksheet from Spreadsheet API?
- Automated Report Post‑processing – After generating a final financial report, automatically remove intermediate worksheets used for temporary calculations, keeping the final file clean and professional.
- Dynamic Cleanup of Template Files – When users generate customized documents (e.g., quotations) from a template, delete optional pages that were not selected.
- Optimization of Workflow Archiving – After a project or audit is completed, remove draft or collaboration worksheets, retaining only the final version for archiving and compliance.
Why should you use the Delete worksheet from Spreadsheet API?
- Developer‑Friendly – Aspose.Cells Cloud offers SDK libraries in multiple languages, enabling rapid development and providing comprehensive documentation.
- Reduced Labor Costs – Eliminates the need for dedicated personnel to consolidate documents manually.
- Pay‑per‑Use – No upfront investment; you only pay for the API calls you actually use.
- Zero Maintenance Costs – No servers to maintain, no software updates, and no compatibility concerns.
How to Use the Delete worksheet from Spreadsheet API with SDKs
Delete worksheet from Spreadsheet API Specification
The Delete worksheet from Spreadsheet API Specification defines a publicly accessible programming interface, allowing you to carry out REST interactions directly from a web browser.
You can use the cURL command‑line tool to access Aspose.Cells web services easily. The following example shows how to make calls to the Cloud API with cURL.
Use Aspose.Cells Cloud SDKs
Using an SDK is the fastest way to develop, as it abstracts low‑level details and lets you delete a worksheet with minimal code. Please check the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to call Aspose.Cells web services using various SDKs: