OleObject Class
Represents an OleObject in a worksheet.
Inheritance Hierarchy
SystemObject
  Aspose.Cells.DrawingShape
    Aspose.Cells.DrawingOleObject

Namespace: Aspose.Cells.Drawing
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.11.0.0 (19.11)
Syntax
public class OleObject : Shape

The OleObject type exposes the following members.

Properties
  NameDescription
Public propertyActiveXControl
Gets the ActiveX control.
(Inherited from Shape.)
Public propertyActualLowerRightRow
Get the actual bottom row.
(Inherited from Shape.)
Public propertyAlternativeText
Returns or sets the descriptive (alternative) text string of the Shape object.
(Inherited from Shape.)
Public propertyAutoLoad
Specifies whether the host application for the embedded object shall be called to load the object data automatically when the parent workbook is opened.
Public propertyAutoShapeType
Gets the auto shape type.
(Inherited from Shape.)
Public propertyAutoUpdate
Specifies whether the link to the OleObject is automatically updated or not.
Public propertyBottom
Represents the width of the shape's vertical offset from its lower bottom corner row, in unit of pixels.
(Inherited from Shape.)
Public propertyClassIdentifier
Gets and sets the class identifier of the embedded object. It means which application opens the embedded file.
Public propertyConnectionPoints
Get the connection points
(Inherited from Shape.)
Public propertyControlData
Gets the data of control.
(Inherited from Shape.)
Public propertyDisplayAsIcon
True if the specified object is displayed as an icon and the image will not be auto changed.
Public propertyFileFormatType
Gets and sets the file type of the embedded ole object data
Public propertyFileType Obsolete.
Gets and sets the file type of the embedded ole object data
Public propertyFill
Returns a FillFormat object that contains fill formatting properties for the specified shape.
(Inherited from Shape.)
Public propertyFillFormat Obsolete.
Returns a MsoFillFormat object that contains fill formatting properties for the specified shape.
(Inherited from Shape.)
Public propertyFont
Represents the font of shape.
(Inherited from Shape.)
Public propertyFormat Obsolete.
Represents the setting of the shape's formatting.
(Inherited from Shape.)
Public propertyFormatPicture
Gets and sets the options of the picture format.
(Inherited from Shape.)
Public propertyFullObjectBin
Gets the full embedded ole object binary data in the template file.
Public propertyGeometry
Gets the geometry
(Inherited from Shape.)
Public propertyGlow
Represents a object that specifies glow effect for the chart element or shape.
(Inherited from Shape.)
Public propertyGroup
Gets the group shape which contains this shape.
(Inherited from Shape.)
Public propertyHasLine
Gets and sets the line border of the shape is visible.
(Inherited from Shape.)
Public propertyHeight
Represents the height of shape, in unit of pixel.
(Inherited from Shape.)
Public propertyHeightCM
Represents the height of the shape, in unit of inches.
(Inherited from Shape.)
Public propertyHeightInch
Represents the height of the shape, in unit of inches.
(Inherited from Shape.)
Public propertyHeightInShape
Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape..
(Inherited from Shape.)
Public propertyHeightPt
Represents the height of the shape, in unit of points.
(Inherited from Shape.)
Public propertyHeightScale
Gets and sets the height scale,in unit of percent of the original picture height. If the shape is not picture ,the HeightScale property only returns 100;
(Inherited from Shape.)
Public propertyHtmlText
Gets and sets the html string which contains data and some formats in this textbox.
(Inherited from Shape.)
Public propertyHyperlink
Gets the hyperlink of the shape.
(Inherited from Shape.)
Public propertyId
Gets the identifier of this shape.
(Inherited from Shape.)
Public propertyImageData
Represents image of ole object as byte array.
Public propertyImageFormat Obsolete.
Gets the image format of the picture.
Public propertyImageSourceFullName
Gets or sets the path and name of the source file for the linked image.
Public propertyImageType
Gets the image format of the ole object.
Public propertyInputRange
Gets or sets the worksheet range used to fill the specified combo box.
(Inherited from Shape.)
Public propertyIsAutoSize
True indicates that the size of the ole object will be auto changed as the size of snapshop of the embedded content when the ole object is activated.
Public propertyIsEquation
Inidicates whether the shape only contains an equation.
(Inherited from Shape.)
Public propertyIsFilled
Indicates whether the fill format is visible.
(Inherited from Shape.)
Public propertyIsFlippedHorizontally
Gets and sets whether shape is horizontally flipped .
(Inherited from Shape.)
Public propertyIsFlippedVertically
Gets and sets whether shape is vertically flipped .
(Inherited from Shape.)
Public propertyIsGroup
Indicates whether the shape is a group.
(Inherited from Shape.)
Public propertyIsHidden
Indicates whether the object is visible.
(Inherited from Shape.)
Public propertyIsLink
Returns true if the OleObject is linked
Public propertyIsLockAspectRatio
True means that don't allow changes in aspect ratio.
(Inherited from Shape.)
Public propertyIsLocked
True if the object is locked, False if the object can be modified when the sheet is protected.
(Inherited from Shape.)
Public propertyIsPrintable
True if the object is printable
(Inherited from Shape.)
Public propertyIsRichText
Whether or not the text is rich text.
(Inherited from Shape.)
Public propertyIsSmartArt
Inidicates whether the shape is smart art.
(Inherited from Shape.)
Public propertyIsTextWrapped
Gets and sets the text wrapped type of the shape which contains text.
(Inherited from Shape.)
Public propertyIsWordArt
Indicates whether this shape is a word art.
(Inherited from Shape.)
Public propertyLabel
Gets and sets the display label of the linked ole object.
Public propertyLeft
Represents the horizontal offset of shape from its left column, in unit of pixels.
(Inherited from Shape.)
Public propertyLeftCM
Represents the horizontal offset of shape from its left column, in unit of centimeters.
(Inherited from Shape.)
Public propertyLeftInch
Represents the horizontal offset of shape from its left column, in unit of inches.
(Inherited from Shape.)
Public propertyLeftInShape
Represents the horizontal offset of shape from the left border of the parent shape, in unit of 1/4000 of width of the parent shape.
(Inherited from Shape.)
Public propertyLeftToCorner
Gets and sets the horizonal offset of shape from worksheet left border.
(Inherited from Shape.)
Public propertyLine
Gets line style
(Inherited from Shape.)
Public propertyLineFormat Obsolete.
Returns a MsoLineFormat object that contains line formatting properties for the specified shape.
(Inherited from Shape.)
Public propertyLinkedCell
Gets or sets the worksheet range linked to the control's value.
(Inherited from Shape.)
Public propertyLowerDeltaX
Gets or sets the shape's horizontal offset from its lower right corner column.
Remarks
The range of value is 0 to 1024.
(Inherited from Shape.)
Public propertyLowerDeltaY
Gets or sets the shape's vertical offset from its lower right corner row.
Remarks
The range of value is 0 to 256.
(Inherited from Shape.)
Public propertyLowerRightColumn
Represents lower right corner column index.
(Inherited from Shape.)
Public propertyLowerRightRow
Represents lower right corner row index.
(Inherited from Shape.)
Public propertyMacroName
Gets and sets the name of macro.
(Inherited from Shape.)
Public propertyMsoDrawingType
Gets and sets mso drawing type.
(Inherited from Shape.)
Public propertyName
Gets and sets the name of the shape.
(Inherited from Shape.)
Public propertyObjectData
Represents embedded ole object data as byte array.
Public propertyObjectSourceFullName
Returns the source full name of the source file for the linked OLE object.
Public propertyPaths
Gets the paths of a custom geometric shape.
(Inherited from Shape.)
Public propertyPlacement
Represents the way the drawing object is attached to the cells below it. The property controls the placement of an object on a worksheet.
(Inherited from Shape.)
Public propertyProgID
Gets or sets the ProgID of the OLE object.
Public propertyReflection
Represents a object that specifies reflection effect for the chart element or shape.
(Inherited from Shape.)
Public propertyRelativeToOriginalPictureSize
Indicates whether shape is relative to original picture size.
(Inherited from Shape.)
Public propertyRight
Represents the width of the shape's horizontal offset from its lower right corner column, in unit of pixels.
(Inherited from Shape.)
Public propertyRotationAngle
Gets and sets the rotation of the shape.
(Inherited from Shape.)
Public propertyShadowEffect
Represents a object that specifies shadow effect for the chart element or shape.
(Inherited from Shape.)
Public propertySoftEdges
Gets and sets the radius of blur to apply to the edges, in unit of points.
(Inherited from Shape.)
Public propertySourceFullName Obsolete.
Returns the source full name of the source file for the linked OLE object.
Public propertySpid
Specifies an optional string that an application can use to Identify the particular shape.
(Inherited from Shape.)
Public propertySpt
Specifies an optional number that an application can use to associate the particular shape with a defined shape type.
(Inherited from Shape.)
Public propertyText
Represents the string in this TextBox object.
(Inherited from Shape.)
Public propertyTextBody
Gets and ses the setting of the shape's text.
(Inherited from Shape.)
Public propertyTextDirection
Gets/Sets the direction of the text flow for this object.
(Inherited from Shape.)
Public propertyTextEffect
Returns a TextEffectFormat object that contains text-effect formatting properties for the specified shape. Applies to Shape objects that represent WordArt.
(Inherited from Shape.)
Public propertyTextFrame Obsolete.
Returns a TextFrame object that contains the alignment and anchoring properties for the specified shape.
(Inherited from Shape.)
Public propertyTextHorizontalAlignment
Gets and sets the text horizontal alignment type of the shape.
(Inherited from Shape.)
Public propertyTextHorizontalOverflow
Gets and sets the text horizontal overflow type of the shape which contains text.
(Inherited from Shape.)
Public propertyTextOptions
Represents the text options of the shape.
(Inherited from Shape.)
Public propertyTextOrientationType
Gets and sets the text orientation type of the shape.
(Inherited from Shape.)
Public propertyTextShapeType
Gets and sets the preset text shape type.
(Inherited from Shape.)
Public propertyTextVerticalAlignment
Gets and sets the text vertical alignment type of the shape.
(Inherited from Shape.)
Public propertyTextVerticalOverflow
Gets and sets the text vertical overflow type of the shape which contains text.
(Inherited from Shape.)
Public propertyThreeDFormat
Gets and sets 3d format of the shape.
(Inherited from Shape.)
Public propertyTitle
Specifies the title (caption) of the current shape object.
(Inherited from Shape.)
Public propertyTop
Represents the vertical offset of shape from its top row, in unit of pixels.
(Inherited from Shape.)
Public propertyTopCM
Represents the vertical offset of shape from its top row, in unit of centimeters.
(Inherited from Shape.)
Public propertyTopInch
Represents the vertical offset of shape from its top row, in unit of inches.
(Inherited from Shape.)
Public propertyTopInShape
Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape.
(Inherited from Shape.)
Public propertyTopToCorner
Gets and sets the vertical offset of shape from worksheet top boder,in unit of pixel
(Inherited from Shape.)
Public propertyType
Gets the auto shape type.
(Inherited from Shape.)
Public propertyUpperDeltaX
Gets or sets the shape's horizontal offset from its upper left corner column.
Remarks
The range of value is 0 to 1024.
(Inherited from Shape.)
Public propertyUpperDeltaY
Gets or sets the shape's vertical offset from its upper left corner row.
Remarks
The range of value is 0 to 256.
(Inherited from Shape.)
Public propertyUpperLeftColumn
Represents upper left corner column index.
(Inherited from Shape.)
Public propertyUpperLeftRow
Represents upper left corner row index.
(Inherited from Shape.)
Public propertyWidth
Represents the width of shape, in unit of pixels.
(Inherited from Shape.)
Public propertyWidthCM
Represents the width of the shape, in unit of centimeters.
(Inherited from Shape.)
Public propertyWidthInch
Represents the width of the shape, in unit of inch.
(Inherited from Shape.)
Public propertyWidthInShape
Represents the width of the shape, in unit of 1/4000 of the parent shape.
(Inherited from Shape.)
Public propertyWidthPt
Represents the width of the shape, in unit of point.
(Inherited from Shape.)
Public propertyWidthScale
Gets and sets the width scale, in unit of percent of the original picture width. If the shape is not picture ,the WidthScale property only returns 100;
(Inherited from Shape.)
Public propertyX
Gets and sets the horizontal offset of shape from worksheet left border,in unit of pixels.
(Inherited from Shape.)
Public propertyY
Gets and sets the vertical offset of shape from worksheet top border,in unit of pixels.
(Inherited from Shape.)
Public propertyZOrderPosition
Returns the position of a shape in the z-order.
(Inherited from Shape.)
Methods
  NameDescription
Public methodAddHyperlink
Adds a hyperlink to the shape.
(Inherited from Shape.)
Public methodAlignTopRightCorner
Moves the picture to the top-right corner.
(Inherited from Shape.)
Public methodCalculateTextSize
Recalculate the text area
(Inherited from Shape.)
Public methodCharacters
Returns a Characters object that represents a range of characters within the text.
(Inherited from Shape.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFormatCharacters(Int32, Int32, Font) Obsolete.
Format some chararcters with the font setting.
(Inherited from Shape.)
Public methodFormatCharacters(Int32, Int32, Font, StyleFlag)
Format some chararcters with the font setting.
(Inherited from Shape.)
Public methodGetCharacters
Returns all Characters objects that represents a range of characters within the text .
(Inherited from Shape.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetInputRange
Gets the range used to fill the control.
(Inherited from Shape.)
Public methodGetLinkedCell
Gets the range linked to the control's value.
(Inherited from Shape.)
Public methodGetLockedProperty
Gets the value of locked property.
(Inherited from Shape.)
Public methodGetResultOfSmartArt
Converting smart art to grouped shapes.
(Inherited from Shape.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMoveToRange
Moves the shape to a specified range.
(Inherited from Shape.)
Public methodRemoveHyperlink
Remove the hyperlink of the shape.
(Inherited from Shape.)
Public methodSetInputRange
Sets the range used to fill the control.
(Inherited from Shape.)
Public methodSetLinkedCell
Sets the range linked to the control's value.
(Inherited from Shape.)
Public methodSetLockedProperty
Set the locked property.
(Inherited from Shape.)
Public methodSetNativeSourceFullName
Sets the ole native source full file name with path.
Public methodToFrontOrBack
Brings the shape to the front or sends the shape to back.
(Inherited from Shape.)
Public methodToImage(ImageOrPrintOptions)
Returns the bitmap object of the shape .
(Inherited from Shape.)
Public methodToImage(Stream, ImageOrPrintOptions)
Saves the shape to a stream.
(Inherited from Shape.)
Public methodToImage(Stream, ImageFormat)
Creates the shape image and saves it to a stream in the specified format.
(Inherited from Shape.)
Public methodToImage(String, ImageOrPrintOptions)
Saves the shape to a file.
(Inherited from Shape.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdateSelectedValue
Update the selected value by the value of the linked cell.
(Inherited from Shape.)
Examples
[C#]
//Instantiate a new Workbook.
Workbook workbook = new Workbook();
//Get the first worksheet. 
Worksheet sheet = workbook.Worksheets[0];
//Define a string variable to store the image path.
string ImageUrl = @"C:\school.jpg";
//Get the picture into the streams.
FileStream fs = File.OpenRead(ImageUrl);
//Define a byte array.
byte[] imageData = new Byte[fs.Length];
//Obtain the picture into the array of bytes from streams.
fs.Read(imageData, 0, imageData.Length);
//Close the stream.
fs.Close();
//Get an excel file path in a variable.
string path = @"C:\Book1.xls";
//Get the file into the streams.
fs = File.OpenRead(path);
//Define an array of bytes. 
byte[] objectData = new Byte[fs.Length];
//Store the file from streams.
fs.Read(objectData, 0, objectData.Length);
//Close the stream.
fs.Close();
//Add an Ole object into the worksheet with the image
//shown in MS Excel.
sheet.OleObjects.Add(14, 3, 200, 220, imageData);
//Set embedded ole object data.     
sheet.OleObjects[0].ObjectData = objectData;
//Save the excel file
workbook.Save(@"C:\oleobjects.xls");


[Visual Basic]

'Instantiate a new Workbook.
Dim workbook As Workbook = New Workbook()
'Get the first worksheet. 
Dim sheet As Worksheet = workbook.Worksheets(0)
'Define a string variable to store the image path.
Dim ImageUrl As String = @"C:\school.jpg"
'Get the picture into the streams.
Dim fs As FileStream = File.OpenRead(ImageUrl)
'Define a byte array.
Dim imageData(fs.Length) As Byte
'Obtain the picture into the array of bytes from streams.
fs.Read(imageData, 0, imageData.Length)
'Close the stream.
fs.Close()
'Get an excel file path in a variable.
Dim path As String = @"C:\Book1.xls"
'Get the file into the streams.
fs = File.OpenRead(path)
'Define an array of bytes. 
Dim objectData(fs.Length) As Byte
'Store the file from streams.
fs.Read(objectData, 0, objectData.Length)
'Close the stream.
fs.Close()
'Add an Ole object into the worksheet with the image
'shown in MS Excel.
sheet.OleObjects.Add(14, 3, 200, 220, imageData)
'Set embedded ole object data.     
sheet.OleObjects(0).ObjectData = objectData
'Save the excel file
workbook.Save("C:\oleobjects.xls")
See Also