Interface IOleObjects
Represents the Ole objects shape collections.
Inherited Members
System.Collections.Generic.IList<Syncfusion.XlsIO.IOleObject>.IndexOf(Syncfusion.XlsIO.IOleObject)
System.Collections.Generic.IList<Syncfusion.XlsIO.IOleObject>.Insert(System.Int32, Syncfusion.XlsIO.IOleObject)
System.Collections.Generic.IList<Syncfusion.XlsIO.IOleObject>.RemoveAt(System.Int32)
System.Collections.Generic.IList<Syncfusion.XlsIO.IOleObject>.Item[System.Int32]
System.Collections.Generic.ICollection<Syncfusion.XlsIO.IOleObject>.Add(Syncfusion.XlsIO.IOleObject)
System.Collections.Generic.ICollection<Syncfusion.XlsIO.IOleObject>.Clear()
System.Collections.Generic.ICollection<Syncfusion.XlsIO.IOleObject>.Contains(Syncfusion.XlsIO.IOleObject)
System.Collections.Generic.ICollection<Syncfusion.XlsIO.IOleObject>.CopyTo(Syncfusion.XlsIO.IOleObject[], System.Int32)
System.Collections.Generic.ICollection<Syncfusion.XlsIO.IOleObject>.Remove(Syncfusion.XlsIO.IOleObject)
System.Collections.Generic.ICollection<Syncfusion.XlsIO.IOleObject>.Count
System.Collections.Generic.ICollection<Syncfusion.XlsIO.IOleObject>.IsReadOnly
System.Collections.Generic.IEnumerable<Syncfusion.XlsIO.IOleObject>.GetEnumerator()
Namespace: Syncfusion.XlsIO
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public interface IOleObjects : IList<IOleObject>, ICollection<IOleObject>, IEnumerable<IOleObject>, IEnumerable
Methods
Add(String, Image, OleLinkType)
Adds new ole object to the collection.
Declaration
IOleObject Add(string fileName, Image image, OleLinkType linkType)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | File name. |
System.Drawing.Image | image | File image. |
OleLinkType | linkType | Link type. |
Returns
Type | Description |
---|---|
IOleObject | Returns a Ole object |
Remarks
This method is not supported in UWP, ASP.NET Core and Xamarin.
Examples
The following code illustrates how to add an IListObject to the IListObjects collection.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create worksheet
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
//Create image stream
System.Drawing.Image image = System.Drawing.Image.FromFile("image.png");
//Add ole object
IOleObject oleObject = worksheet.OleObjects.Add("Shapes.xlsx", image, OleLinkType.Embed);
//Save and dispose
workbook.SaveAs("OLEObjects.xlsx");
workbook.Close();
}