GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ExcelEmbeddedObject Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents an embedded Excel object within a spreadsheet, such as an embedded Excel workbook or chart.

    • C#
    • VB.NET
    public sealed class ExcelEmbeddedObject : ExcelDrawing
    Public NotInheritable Class ExcelEmbeddedObject
        Inherits ExcelDrawing
    Inheritance:
    System.Object
    ExcelDrawing
    ExcelEmbeddedObject

    Properties

    ContentType

    Gets the content type of the embedded object data.

    • C#
    • VB.NET
    public string ContentType { get; }
    Public ReadOnly Property ContentType As String
    Property Value
    System.String

    The content type of the embedded object data.

    Data

    Gets the embedded object data.

    • C#
    • VB.NET
    public MemoryStream Data { get; }
    Public ReadOnly Property Data As MemoryStream
    Property Value
    System.IO.MemoryStream

    A System.IO.MemoryStream containing the embedded object data.

    IsLinked

    Gets a value indicating whether this object or control is linked.

    • C#
    • VB.NET
    public bool IsLinked { get; }
    Public ReadOnly Property IsLinked As Boolean
    Property Value
    System.Boolean

    true if this object or control is linked; otherwise, false if it is embedded.

    Link

    Gets the link associated with the embedded object, if it is linked.

    • C#
    • VB.NET
    public string Link { get; }
    Public ReadOnly Property Link As String
    Property Value
    System.String

    The link to the external object.

    Path

    Gets the path or link associated with the embedded object.

    • C#
    • VB.NET
    public string Path { get; }
    Public ReadOnly Property Path As String
    Property Value
    System.String
    Exceptions
    System.InvalidOperationException

    Thrown if the path cannot be determined if the object is linked with a null link.

    Picture

    Gets or sets the preview picture associated with the OLE object.

    • C#
    • VB.NET
    public ExcelPicture Picture { get; set; }
    Public Property Picture As ExcelPicture
    Property Value
    ExcelPicture

    The preview Picture representing the OLE object.

    ProgId

    Gets or sets the program identifier (ProgId) associated with the embedded object.

    • C#
    • VB.NET
    public string ProgId { get; set; }
    Public Property ProgId As String
    Property Value
    System.String

    The ProgId for the embedded object.

    ShowAsIcon

    Gets or sets a value indicating whether the object is displayed as an icon or using its native representation.

    • C#
    • VB.NET
    public bool ShowAsIcon { get; set; }
    Public Property ShowAsIcon As Boolean
    Property Value
    System.Boolean

    true if the object is displayed as an icon; otherwise, false if it is displayed using its native representation.

    UpdateMode

    Gets or sets the update type for the embedded object.

    • C#
    • VB.NET
    public OleUpdateMode UpdateMode { get; set; }
    Public Property UpdateMode As OleUpdateMode
    Property Value
    OleUpdateMode

    The OleUpdateMode value indicating how the embedded object is updated.

    Methods

    SetData(Stream, String, String)

    Sets the data for the embedded object from the specified stream.

    • C#
    • VB.NET
    public void SetData(Stream stream, string sourcePath, string explicitContentType = null)
    Public Sub SetData(stream As Stream, sourcePath As String, explicitContentType As String = Nothing)
    Parameters
    stream
    System.IO.Stream

    The stream containing the embedded object data.

    sourcePath
    System.String

    The source path of the embedded object.

    explicitContentType
    System.String

    The explicit content type of the embedded object, if any.

    Exceptions
    System.ArgumentNullException

    Thrown if stream or sourcePath is null.

    SetData(String, String)

    Sets the data for the embedded object from the specified file path.

    • C#
    • VB.NET
    public void SetData(string path, string explicitContentType = null)
    Public Sub SetData(path As String, explicitContentType As String = Nothing)
    Parameters
    path
    System.String

    The file path containing the embedded object data.

    explicitContentType
    System.String

    The explicit content type of the embedded object, if any.

    Exceptions
    System.ArgumentNullException

    Thrown if path is null.

    System.IO.FileNotFoundException

    Thrown if the file at path does not exist.

    SetLink(String, String, String)

    Sets the link for the embedded object.

    • C#
    • VB.NET
    public void SetLink(string link, string range = null, string explicitContentType = null)
    Public Sub SetLink(link As String, range As String = Nothing, explicitContentType As String = Nothing)
    Parameters
    link
    System.String

    The link to the external object.

    range
    System.String

    The range within the linked object, if any.

    explicitContentType
    System.String

    The explicit content type of the embedded object, if any.

    Exceptions
    System.ArgumentNullException

    Thrown if link is null.

    SetPicture(MemoryStream, ExcelPictureFormat)

    Sets the preview picture or the icon (ShowAsIcon) for the embedded object.

    • C#
    • VB.NET
    public void SetPicture(MemoryStream stream, ExcelPictureFormat pictureFormat)
    Public Sub SetPicture(stream As MemoryStream, pictureFormat As ExcelPictureFormat)
    Parameters
    stream
    System.IO.MemoryStream
    pictureFormat
    ExcelPictureFormat

    SetPicture(String)

    Sets the preview picture or the icon (ShowAsIcon) for the embedded object.

    • C#
    • VB.NET
    public void SetPicture(string path)
    Public Sub SetPicture(path As String)
    Parameters
    path
    System.String

    The picture's path.

    ToString()

    Returns a System.String that represents this ExcelEmbeddedObject instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this ExcelEmbeddedObject instance.

    Overrides
    System.Object.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Inherited Properties

    Hyperlink

    Gets or sets the hyperlink on this drawing (picture, chart, etc.).

    (Inherited from ExcelDrawing)

    Metadata

    Gets the metadata (non-visual properties) of this ExcelDrawing instance.

    (Inherited from ExcelDrawing)

    Position

    Gets the position of this drawing (picture, chart, etc.) in the worksheet.

    (Inherited from ExcelDrawing)

    Worksheet

    Gets the parent worksheet.

    (Inherited from ExcelDrawing)

    ZIndex

    Gets the z-order position of the picture. -1 if the picture is not contained in proper collection.

    (Inherited from ExcelDrawing)

    Inherited Methods

    Format()

    Formats this drawing (picture, chart, etc.) to its default size so it can be exported to PDF, XPS, image or be printed.

    (Inherited from ExcelDrawing)

    Format(System.Double, System.Double, LengthUnit)

    Formats this drawing (picture, chart, etc.) to specified size so it can be exported to PDF, XPS, image or be printed.

    (Inherited from ExcelDrawing)

    See Also

    EmbeddedObjects
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.