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}

Security and Authentication

The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.

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.

Response

Return CellResponse.

  • Response Fields Overview
Field Type Description
Name string Address of the cell (e.g., F341).
Row integer Zero‑based row index.
Column integer Zero‑based column index.
Value string The cell’s displayed value.
Type string Data type of the cell (e.g., IsString).
Formula string Formula text if the cell contains a formula.
IsFormula bool Indicates whether the cell contains a formula.
IsMerged bool Indicates whether the cell is part of a merged range.
IsArrayHeader bool Indicates whether the cell is an array header.
IsInArray bool Indicates whether the cell belongs to an array.
IsErrorValue bool Indicates whether the cell contains an error value.
IsInTable bool Indicates whether the cell is inside a table.
IsStyleSet bool Indicates whether a style is applied to the cell.
HtmlString string HTML‑encoded representation of the cell’s value.
Style.link object Hyperlink to the style resource.
{
  "Status":"OK",
  "Code":200,
  "Cell":{
    "Name":"A1",
    "Row": 0,
    "Column":0,
    "Value": "",
    "Type":"String",
    "Formula" : "=Sum(A2:A15)",
    ...
  }
}

Http Status Codes

Code Meaning Description
200 OK Compression succeeded; response contains compressed file 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.

How to Use the PostWorksheetCellSetValue API with SDKs

PostWorksheetCellSetValue API Specification

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.

Use Aspose.Cells Cloud SDKs

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: