Back to Devexpress

OleObjectCollection.AddLinkedOleObject(CellRange, String, OleObjectType, SpreadsheetImageSource) Method

officefileapi-devexpress-dot-spreadsheet-dot-oleobjectcollection-dot-addlinkedoleobject-x28-cellrange-string-oleobjecttype-spreadsheetimagesource-x29.md

latest2.8 KB
Original Source

OleObjectCollection.AddLinkedOleObject(CellRange, String, OleObjectType, SpreadsheetImageSource) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Inserts a linked OLE object into the specified cell range.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
OleObject AddLinkedOleObject(
    CellRange targetRange,
    string fileName,
    OleObjectType oleObjectType,
    SpreadsheetImageSource objectRepresentation = null
)
vb
Function AddLinkedOleObject(
    targetRange As CellRange,
    fileName As String,
    oleObjectType As OleObjectType,
    objectRepresentation As SpreadsheetImageSource = Nothing
) As OleObject

Parameters

NameTypeDescription
targetRangeCellRange

A cell range to store the created OLE object.

| | fileName | String |

A path (including the file name) of the file to link.

| | oleObjectType | OleObjectType |

OLE object content type.

|

Optional Parameters

NameTypeDefaultDescription
objectRepresentationSpreadsheetImageSourcenull

Specifies the image to depict the OLE object on the worksheet. If null, a white boilerplate image is used.

|

Returns

TypeDescription
OleObject

The created OLE object.

|

See Also

Work with OLE Objects

OleObjectCollection Interface

OleObjectCollection Members

DevExpress.Spreadsheet Namespace