Add OLE Object to Excel Worksheet with Aspose.Cells Cloud API

The Aspose.Cells Cloud API enables programmatic manipulation of Excel workbooks, including the ability to embed OLE objects (e.g., Word documents, PDFs, or other binary files) directly into a worksheet.

This REST API adds an OLE object to an Excel worksheet.

Prerequisites – You must have a valid JWT authentication token, and any source files referenced by oleFile or imageFile should be uploaded to the specified storage location before invoking the endpoint.

PutWorksheetOleObject API

PUT https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/oleobjects

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 workbook file name.
sheetName string path The worksheet name.
oleObject object body The OLE object definition.
upperLeftRow integer query Row index of the upper‑left corner (default 0).
upperLeftColumn integer query Column index of the upper‑left corner (default 0).
height integer query Height of the OLE object (default 0).
width integer query Width of the OLE object (default 0).
oleFile string query Name of the OLE source file.
imageFile string query Name of the preview image file.
folder string query Folder that contains the workbook.
storageName string query Name of the storage to use.

NotesupperLeftRow and upperLeftColumn use zero‑based indexing. The oleFile (and optionally imageFile) must already exist in the target storage; otherwise the request will return an error.

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 Aspose.Cells web services. The example below demonstrates how to add an OLE object with cURL. HTTPS is required for all production calls.

Screenshot showing an OLE object embedded in an Excel worksheet

Possible HTTP status codes

Code Description
200 OLE object added successfully.
400 Bad request – missing or invalid parameters.
401 Unauthorized – invalid or missing JWT token.
404 Not found – workbook, worksheet, or source file does not exist.
500 Internal server error – unexpected failure.

A typical successful response returns the following JSON payload:

{
  "Code": 200,
  "Status": "OK",
  "Data": {
    "OleObjectId": "12345",
    "UpperLeftRow": 15,
    "UpperLeftColumn": 5,
    "Width": 400,
    "Height": 400,
    "SourceFullName": "Sample_Book2.xls",
    "ImageSourceFullName": "aspose-logo.png"
  }
}

Cloud SDK Family

Using an SDK speeds up development. An SDK abstracts low‑level details, allowing you to 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 using various SDKs: