How to Rename Worksheets in Excel – Change Sheet Names
Programmatically rename worksheets in Excel workbooks using Aspose.Cells Cloud API. Change sheet names, update tab labels dynamically, and automate spreadsheet organization through RESTful API calls. Useful for document standardization and workflow automation.
Rename worksheet name in Spreadsheet API
Web API
PUT https://api.aspose.cloud/v4.0/cells/spreadsheet/rename/worksheet?sourceName={sourceName}&targetName={targetName}&outPath={outPath}&outStorageName={outStorageName}®ion={region}&password={password}
cURL example
curl -X PUT "https://api.aspose.cloud/v4.0/cells/spreadsheet/rename/worksheet?sourceName=Sheet1&targetName=Report_Q1" \
-H "Authorization: Bearer {access_token}" \
-F "spreadsheet=@myWorkbook.xlsx"
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 Excel workbook file (.xlsx, .xls, etc.) containing the worksheet to be renamed. |
| sourceName | String | Query | Required. The current name of the worksheet you wish to rename. |
| targetName | String | Query | Required. The new name to assign to the worksheet. Must follow Excel naming rules (no :, \, ?, *, [, ]) and be unique within the workbook. |
| outPath | String | Query | Optional. The target folder path in cloud storage where the renamed workbook will be saved. If null or omitted, the service saves the file to the same folder as the source workbook (or a default path). |
| outStorageName | String | Query | Optional. The name identifier of your configured cloud storage service (e.g., ArchiveStorage). If omitted, the default storage is used. |
| region | String | Query | Optional. The locale setting (e.g., ko-KR) that may influence character encoding or regional naming conventions. |
| password | String | Query | Optional. The decryption password required to open and modify a password‑protected workbook. Omit if the file is not encrypted. |
Notes: Worksheet names are limited to 31 characters and cannot contain the characters :, \, ?, *, [, or ].
Response
A successful request returns a JSON object with status information and a link to the renamed file.
[
{
"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 Rename Worksheet in Spreadsheet API?
- Report Generation and Brand Standardization – When generating customer reports automatically, generic worksheet names (e.g.,
Sheet1) are renamed to customer‑specific names (e.g.,AcmeCorp_Q1_Summary) to ensure a professional delivery. - Data‑Processing Pipeline Standardization – In ETL workflows, worksheets exported with irregular names are renamed to standardized names such as
Raw_DataorCleaned_Datato satisfy downstream analysis requirements. - Multilingual Content Delivery – Based on the user’s language preference, worksheet names are localized (e.g.,
数据orData) before the file is delivered, providing a tailored experience.
Why should you use the Rename Worksheet in Spreadsheet API?
- Developer‑Friendly – Provides SDKs for several languages with comprehensive documentation, simplifying integration compared to building a custom solution.
- Reduced Labor – Automates worksheet renaming, decreasing manual effort.
- Pay‑per‑Use Model – Charges only for API calls, eliminating upfront licensing costs.
- No Server Maintenance – As a cloud service, it removes the need to host and maintain servers or apply software updates.
- Automation Support – Facilitates automated document standardization within workflows.
How to Use the Rename Worksheet in Spreadsheet API with SDKs
OpenAPI Specification
The OpenAPI Specification details a publicly accessible programming interface, allowing for 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 quickest way to accelerate development. The SDK abstracts the underlying HTTP details, letting you rename worksheets with minimal code. See the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples illustrate how to call Aspose.Cells web services using various SDKs: