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
API Endpoint
PUT http://api.aspose.cloud/v4.0/cells/spreadsheet/delete/worksheet
Request Parameters:
| Parameter Name | Type | Path/Query String/HTTPBody | 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). This name must match an existing sheet in the workbook. |
| outPath | String | Query | Optional. The target folder path in cloud storage where the modified workbook will be saved. If null or omitted, it is saved in the same location as the source file or a default path. |
| outStorageName | String | Query | Required. The name identifier of your configured cloud storage service (e.g., ProjectStorage) where the output file will be written. |
| region | String | Query | Optional. The locale setting (e.g., it-IT) to apply, which may affect the handling of region-specific formulas or data during the save operation. |
| password | String | Query | Optional. The decryption 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"
}
}
]
Error Codes
- 400 Bad Request: Invalid Aspose.Cells Cloud API URI.
- 401 Unauthorized: Invalid access token. Or invalid client id and secret.
- 404 Not Found: The spreadsheet file not accessible.
- 500 Server Error: The spreadsheet has encountered an anomaly in obtaining calculation data.
Where should we use the Delete worksheet from Spreadsheet API?
- Automated Report Post-processing: After the system completes data filling and generates the final financial report, automatically remove the intermediate work sheets used for temporary calculations or data transfer, maintaining the simplicity and professionalism of the final file.
- Dynamic Cleanup of Template Files: After users generate customized files (such as quotations) based on the template through the portal, automatically delete the unnecessary options or explanatory pages preset in the template that the user ultimately did not select.
- Optimization of Workflow Archiving: When a project is completed or an audit is finished, automatically remove the temporary work sheets used for collaboration and drafts from the main workbook, retaining only the final version for archiving, ensuring the clarity and compliance of the archives.
Why should you use the Delete worksheet from Spreadsheet API?
- Developer-Friendly: Aspose.Cells Cloud offers SDK libraries in multiple languages, enabling quick development and comes with comprehensive documentation. Compared to building custom chart rendering solutions, this significantly reduces the development workload.
- Reduced Labor Costs: Reduced the need for positions dedicated to document consolidation.
- Pay-per-use: No upfront investment, only pay for API calls actually used.
- Zero Maintenance Costs: No need to maintain servers, update software, or deal with compatibility issues.
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.
Use Aspose.Cells Cloud SDKs
Using the SDK is the fastest way to develop, as it abstracts away the low-level details, allowing you to delete a worksheet from the spreadsheet with short code. Please check out 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: