Add a List Object (Table) to an Excel Worksheet – Aspose.Cells Cloud Documentation
This REST API adds a list object (table) to an Excel worksheet.
Before using this endpoint, ensure you have a valid JWT token, the workbook is stored in a supported cloud storage, and the worksheet exists.
REST API
PUT https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/listobjects
Request parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | Workbook file name. |
| sheetName | string | path | Worksheet name. |
| startRow | integer | query | Zero‑based index of the first row of the table range. |
| startColumn | integer | query | Zero‑based index of the first column of the table range. |
| endRow | integer | query | Zero‑based index of the last row of the table range. |
| endColumn | integer | query | Zero‑based index of the last column of the table range. |
| hasHeaders | boolean | query | true if the first row contains column headers; otherwise false. |
| listObject | object | body | Definition of the list object (see Request body schema). |
| folder | string | query | Folder that contains the workbook. |
| storageName | string | query | Storage name. |
Request body schema
The listObject object describes the table that will be created. Only the most common properties are shown; see the OpenAPI specification for the complete list.
{
"displayName": "MyTable",
"showTotals": false,
"style": "TableStyleMedium2"
}
Example request (cURL)
curl -v "https://api.aspose.cloud/v3.0/cells/Book1.xlsx/worksheets/Sheet1/listobjects?startRow=1&startColumn=1&endRow=10&endColumn=12&hasHeaders=true" \
-X PUT \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>" \
-d '{
"displayName": "MyTable",
"showTotals": false,
"style": "TableStyleMedium2"
}'
Example response
{
"Code": 200,
"Status": "OK"
}
Error codes
| HTTP Status | Reason | Description |
|---|---|---|
| 400 | Bad Request | Invalid range parameters or malformed JSON body. |
| 401 | Unauthorized | Missing or expired JWT token. |
| 404 | Not Found | Specified workbook or worksheet does not exist. |
| 500 | Internal Server Error | Unexpected server‑side failure. |
Example 400 response
{
"Code": 400,
"Status": "Bad Request",
"Message": "Invalid range parameters."
}
Example 401 response
{
"Code": 401,
"Status": "Unauthorized",
"Message": "Authentication token is missing or expired."
}
The OpenAPI Specification provides the full contract for this operation.
Cloud SDK Family
Using an SDK is the best way to speed up development. An SDK handles low‑level details and lets you 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: