Working with Excel OLE Objects – Guide to Retrieve, Add, Update, Delete, and Convert OLE Objects
Contents
[
Hide
]
How to work with OLE objects in an Excel worksheet
The Aspose.Cells Cloud REST API provides a complete set of operations to manage OLE objects programmatically. Below is a concise reference for each operation, including the HTTP method, endpoint pattern, required parameters, and a brief example response.
-
How to get an OLE object from an Excel worksheet
- Method:
GET - Endpoint:
/cells/{fileName}/worksheets/{sheetName}/oleobjects/{oleObjectIndex} - Parameters:
fileName(string),sheetName(string),oleObjectIndex(integer) - Sample response:
{ "OleObject": { "Name": "Chart1", "ContentType": "image/png", "Width": 400, "Height": 300 } }
- Method:
-
How to add an OLE object into an Excel worksheet
- Method:
POST - Endpoint:
/cells/{fileName}/worksheets/{sheetName}/oleobjects - Parameters:
fileName,sheetName,oleObject(binary or base‑64),imageFormat(optional) - Sample request body: multipart/form‑data with the file stream.
- Sample response:
201 Createdwith location header of the new OLE object.
- Method:
-
How to update a specific OLE object in an Excel worksheet
- Method:
PUT - Endpoint:
/cells/{fileName}/worksheets/{sheetName}/oleobjects/{oleObjectIndex} - Parameters:
fileName,sheetName,oleObjectIndex,oleObject(updated content) - Sample response:
200 OKwith updated object metadata.
- Method:
-
How to convert an OLE object to an image in an Excel worksheet
- Method:
GET - Endpoint:
/cells/{fileName}/worksheets/{sheetName}/oleobjects/{oleObjectIndex}/convert - Parameters:
fileName,sheetName,oleObjectIndex,format(e.g.,png,jpeg) - Sample response: Binary image stream of the converted OLE object.
- Method:
-
How to delete all OLE objects in an Excel worksheet
- Method:
DELETE - Endpoint:
/cells/{fileName}/worksheets/{sheetName}/oleobjects - Parameters:
fileName,sheetName - Sample response:
204 No Contentindicating all OLE objects were removed.
- Method:
-
How to delete a specific OLE object in an Excel worksheet
- Method:
DELETE - Endpoint:
/cells/{fileName}/worksheets/{sheetName}/oleobjects/{oleObjectIndex} - Parameters:
fileName,sheetName,oleObjectIndex - Sample response:
204 No Contentconfirming the object was deleted.
- Method: