Get OLE Object from Excel Worksheet – Aspose.Cells Cloud API
This REST API retrieves an OLE object from an Excel worksheet.
Prerequisites
- Aspose.Cells Cloud SDK version 23.5 or later (or use the raw REST endpoint).
- Authentication – a JWT access token obtained via the Aspose Cloud OAuth flow. The token must be sent in the
Authorization: Bearer <token>header. Required scope:Cells.Read. - HTTPS – all requests must be made over TLS (
https://).
Rest API
GET https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/oleobjects/{objectNumber}?format={format}
The request parameters are listed below:
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | Document name. |
| sheetName | string | path | Worksheet name. |
| objectNumber | integer | path | The object number within the worksheet. |
| format | string | query | Desired export format for the object (e.g., png, jpeg). |
| folder | string | query | Folder that contains the document. |
| storageName | string | query | Name of the storage to use. |
Storage Options
- folder – specifies the sub‑folder in the default storage where the workbook resides.
- storageName – overrides the default storage name if the workbook is stored elsewhere.
The OpenAPI Specification defines a publicly accessible programming interface and lets you perform REST interactions directly from a web browser.
You can use the cURL command‑line tool to call the Aspose.Cells web service. The example below demonstrates how to request an OLE object as a PNG image.
Error Responses
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | BadRequest | Missing or invalid parameters. |
| 401 | Unauthorized | Invalid or missing JWT token. |
| 404 | NotFound | Workbook, worksheet, or OLE object not found. |
| 500 | ServerError | Unexpected server error. |
FAQ
How do I retrieve an OLE object as a PNG image using Aspose.Cells Cloud?
Use the GET endpoint with the format=png query parameter. Example:
curl -X GET "https://api.aspose.cloud/v3.0/cells/MyBook.xlsx/worksheets/Sheet1/oleobjects/0?format=png" \
-H "Authorization: Bearer <jwt>"
The response will be a binary PNG image (Content‑Type: image/png).
What authentication is required for the Get OLE Object API?
A JWT access token obtained via the Aspose Cloud OAuth flow. Include the token in the Authorization: Bearer <token> header. The required scope is Cells.Read.
What error codes can the Get OLE Object endpoint return?
- 400 Bad Request – missing or invalid parameters.
- 401 Unauthorized – invalid or missing JWT.
- 404 Not Found – workbook, worksheet, or OLE object does not exist.
- 500 Internal Server Error – unexpected server error.
Cloud SDK Family
Using an SDK is the fastest way to integrate the API. SDKs handle low‑level details so you can focus on your business logic. See the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to call Aspose.Cells web services with various SDKs: