Get Cell Style from a Worksheet – Aspose.Cells Cloud API
REST API
Use this REST API to retrieve the style of a cell in an Excel worksheet.
GET https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/cells/{cellName}/style
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
Request Parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | The name of the Excel document. |
| sheetName | string | path | The name of the worksheet. |
| cellName | string | path | The address of the cell (e.g., A1). |
| folder | string | query | The folder that contains the file. |
| storageName | string | query | The name of the storage to use. |
Response
{
"Style": {
"Font": {
"Color": { "A": 255, "R": 5, "G": 99, "B": 193 },
"DoubleSize": 11,
"IsBold": false,
"IsItalic": false,
"IsStrikeout": false,
"IsSubscript": false,
"IsSuperscript": false,
"Name": "Calibri",
"Size": 11,
"Underline": "Single"
},
"Name": null,
"CultureCustom": "General",
"Custom": "",
"BackgroundColor": { "A": 0, "R": 0, "G": 0, "B": 0 },
"ForegroundColor": { "A": 0, "R": 0, "G": 0, "B": 0 },
"IsFormulaHidden": false,
"IsDateTime": false,
"IsTextWrapped": false,
"IsGradient": false,
"IsLocked": true,
"IsPercent": false,
"ShrinkToFit": false,
"IndentLevel": 0,
"Number": 0,
"RotationAngle": 0,
"Pattern": "None",
"TextDirection": "Context",
"VerticalAlignment": "Bottom",
"HorizontalAlignment": "General",
"BorderCollection": [
{
"LineStyle": "None",
"Color": { "A": 255, "R": 0, "G": 0, "B": 0 },
"BorderType": "BottomBorder"
},
{
"LineStyle": "None",
"Color": { "A": 255, "R": 0, "G": 0, "B": 0 },
"BorderType": "DiagonalDown"
},
{
"LineStyle": "None",
"Color": { "A": 255, "R": 0, "G": 0, "B": 0 },
"BorderType": "DiagonalUp"
},
{
"LineStyle": "None",
"Color": { "A": 255, "R": 0, "G": 0, "B": 0 },
"BorderType": "Horizontal"
},
{
"LineStyle": "None",
"Color": { "A": 255, "R": 0, "G": 0, "B": 0 },
"BorderType": "LeftBorder"
},
{
"LineStyle": "None",
"Color": { "A": 255, "R": 0, "G": 0, "B": 0 },
"BorderType": "RightBorder"
},
{
"LineStyle": "None",
"Color": { "A": 255, "R": 0, "G": 0, "B": 0 },
"BorderType": "TopBorder"
},
{
"LineStyle": "None",
"Color": { "A": 255, "R": 0, "G": 0, "B": 0 },
"BorderType": "Vertical"
}
],
"BackgroundThemeColor": null,
"ForegroundThemeColor": null,
"link": {
"Href": "/test.xlsx/worksheets/Sheet1/cells/a1/style",
"Rel": "self",
"Title": null,
"Type": null
}
},
"Code": 200,
"Status": "OK"
}
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 GetWorksheetCellStyle API with SDKs
GetWorksheetCellStyle API Specification
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out 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 a call to the Cloud API with cURL.
Response Schema
| Field | Type | Description |
|---|---|---|
| Style | object | Container for all style‑related properties of the cell. |
| Style.Font | object | Font settings (name, size, color, style flags). |
| Style.Font.Color | object | RGBA color values for the font. |
| Style.Font.IsBold | boolean | true if the font is bold. |
| Style.Font.IsItalic | boolean | true if the font is italic. |
| Style.Font.IsStrikeout | boolean | true if the font has a strike‑through. |
| Style.Font.IsSubscript | boolean | true if the font is subscript. |
| Style.Font.IsSuperscript | boolean | true if the font is superscript. |
| Style.Font.Name | string | Font family name (e.g., Calibri). |
| Style.Font.Size | number | Font size in points. |
| Style.Font.Underline | string | Underline style (e.g., Single). |
| Style.IsLocked | boolean | Indicates whether the cell is protected from editing. |
| Style.IsTextWrapped | boolean | true if text wrapping is enabled. |
| Style.IsGradient | boolean | true if a gradient fill is applied. |
| Style.Pattern | string | Fill pattern name (e.g., None). |
| Style.BorderCollection | array | List of border objects defining line style, color, and border type. |
| Style.BackgroundColor | object | RGBA values for the cell background. |
| Style.ForegroundColor | object | RGBA values for the cell foreground. |
| … | … | (Other fields follow the same pattern as defined in the API reference.) |
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 call Aspose.Cells web services using various SDKs: