Back to Devexpress

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

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

latest3.4 KB
Original Source

OleObjectCollection.AddLinkedOleObject(Single, Single, Single, Single, 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 from a file into the specified position.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
OleObject AddLinkedOleObject(
    float x,
    float y,
    float width,
    float height,
    string fileName,
    OleObjectType oleObjectType,
    SpreadsheetImageSource objectRepresentation = null
)
vb
Function AddLinkedOleObject(
    x As Single,
    y As Single,
    width As Single,
    height As Single,
    fileName As String,
    oleObjectType As OleObjectType,
    objectRepresentation As SpreadsheetImageSource = Nothing
) As OleObject

Parameters

NameTypeDescription
xSingle

The horizontal coordinate of the OLE object’s image top-left corner, in pixels. The origin point (0,0) is the worksheet’s top-left corner.

| | y | Single |

The vertical coordinate of the OLE object’s image top-left corner, in pixels. The origin point (0,0) is the worksheet’s top-left corner.

| | width | Single |

The OLE object’s image width.

| | height | Single |

The OLE object’s image height.

| | 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