Set Cell Formula in Excel Worksheets

This REST API sets a cell formula in an Excel file.

REST API

POST https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/cells/{cellName}

Prerequisites
Before calling this endpoint you must obtain an OAuth2 access token and include it in the Authorization header. The workbook must already exist in the selected storage (or be uploaded beforehand).

Request parameters

Parameter Name Type Location Required Description
name string path Y Name of the Excel document.
sheetName string path Y Name of the worksheet.
cellName string path Y Address of the target cell (e.g., A1).
value string query N Value to assign to the cell.
type string query N Data type of the value (e.g., string).
formula string query N Formula to apply to the cell (e.g., sum(A1,A2)).
folder string query N Folder that contains the document.
storageName string query N Name of the storage service.

The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.

Use the cURL command‑line tool to call Aspose.Cells web services.

Error handling
The API can return the following status codes:

Code Meaning Example JSON payload
400 Bad Request – missing or invalid parameters { "Code": 400, "Message": "The 'formula' parameter is required." }
401 Unauthorized – invalid or missing token { "Code": 401, "Message": "Access token is missing or invalid." }
404 Not Found – workbook or worksheet does not exist { "Code": 404, "Message": "File not found." }
500 Internal Server Error – unexpected condition { "Code": 500, "Message": "An unexpected error occurred." }

Cloud SDK Family

Using an SDK is the best way to speed up development. An SDK handles low‑level details so you can 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 make calls to Aspose.Cells web services using various SDKs: