Replace Text in an Excel Worksheet – Aspose.Cells Cloud API
Contents
[
Hide
]
This REST API replaces text in an Excel worksheet using the Aspose.Cells replace text API.
REST API
POST https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/replaceText
Request Parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | The name of the Excel workbook. |
| sheetName | string | path | The name of the worksheet. |
| oldValue | string | query | The text to be replaced. |
| newValue | string | query | The replacement text. |
| folder | string | query | The folder that contains the file. |
| storageName | string | query | The storage service name. |
The OpenAPI Specification defines this publicly accessible interface.
You can use the cURL command‑line tool to call the service:
Response Details
| Property | Type | Description |
|---|---|---|
| Matches | integer | Number of cells where oldValue was replaced. |
| Worksheet.link.Href | string | Relative URL of the affected worksheet. |
| Code | integer | HTTP status code returned by the API (e.g., 200). |
| Status | string | Textual representation of the status (e.g., “OK”). |
Error Handling
| HTTP Status | Example JSON Payload | Meaning |
|---|---|---|
| 400 | { "Code": 400, "Message": "Invalid request.", "Description": "The parameter 'oldValue' is missing." } |
Bad request – required parameter missing or malformed. |
| 401 | { "Code": 401, "Message": "Unauthorized.", "Description": "Access token is invalid or expired." } |
Authentication failure – obtain a new token. |
| 404 | { "Code": 404, "Message": "Worksheet not found.", "Description": "The sheetName 'SheetX' does not exist." } |
The specified worksheet could not be located. |
Cloud SDK Family
Using an SDK is the best way to speed up development. An SDK handles low‑level details, allowing you to focus on your project tasks. 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: