ExcelEmbeddedObjectCollection Class
Represents a read-only collection of ExcelEmbeddedObjects in the worksheet.
public sealed class ExcelEmbeddedObjectCollection : ExcelDrawingCollection<ExcelEmbeddedObject>, IList<ExcelEmbeddedObject>, ICollection<ExcelEmbeddedObject>, IEnumerable<ExcelEmbeddedObject>, IEnumerable
Public NotInheritable Class ExcelEmbeddedObjectCollection
Inherits ExcelDrawingCollection(Of ExcelEmbeddedObject)
Implements IList(Of ExcelEmbeddedObject), ICollection(Of ExcelEmbeddedObject), IEnumerable(Of ExcelEmbeddedObject), IEnumerable
- Inheritance:
- System.ObjectExcelEmbeddedObjectCollection
Implements
Methods
Add(Stream, String, Double, Double, Double, Double, LengthUnit, String)
Adds a new embedded Excel object to the collection, using the specified data stream.
public ExcelEmbeddedObject Add(Stream stream, string originalPathOrFileName, double left, double top, double width, double height, LengthUnit unit, string explicitContentType = null)
Public Function Add(stream As Stream, originalPathOrFileName As String, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit, explicitContentType As String = Nothing) As ExcelEmbeddedObject
Parameters
stream
- System.IO.Stream
The stream containing the embedded object data.
originalPathOrFileName
- System.String
The original path or file name of the embedded object.
left
- System.Double
The distance of the left edge of the button from the left edge of the worksheet or group.
top
- System.Double
The distance of the top edge of the button from the top edge of the worksheet or group.
width
- System.Double
The button's width.
height
- System.Double
The button's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
explicitContentType
- System.String
The explicit content type of the embedded object, if any.
Returns
A new ExcelEmbeddedObject added to the collection.
Exceptions
- System.ArgumentNullException
Thrown if stream
or originalPathOrFileName
is null.
Add(String, Boolean, Double, Double, Double, Double, LengthUnit, String)
Adds a new embedded or linked Excel object to the collection from the specified file path.
public ExcelEmbeddedObject Add(string path, bool linked, double left, double top, double width, double height, LengthUnit unit, string explicitContentType = null)
Public Function Add(path As String, linked As Boolean, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit, explicitContentType As String = Nothing) As ExcelEmbeddedObject
Parameters
path
- System.String
The file path to the embedded or linked object.
linked
- System.Boolean
Indicates whether the object should be linked (true) or embedded (false).
left
- System.Double
The distance of the left edge of the button from the left edge of the worksheet or group.
top
- System.Double
The distance of the top edge of the button from the top edge of the worksheet or group.
width
- System.Double
The button's width.
height
- System.Double
The button's height.
unit
- LengthUnit
The length unit in which all length parameters are specified.
explicitContentType
- System.String
The explicit content type of the embedded object, if any.
Returns
A new ExcelEmbeddedObject added to the collection.
Exceptions
- System.ArgumentNullException
Thrown if path
is null.
- System.IO.FileNotFoundException
Thrown if the file at path
does not exist.