Syncfusion.XlsIO.Base
Example 


OleObjects Property

Gets IOleObjects collection in the worksheet.
Syntax
'Declaration
 
ReadOnly Property OleObjects As IOleObjects
'Usage
 
Dim instance As IWorksheet
Dim value As IOleObjects
 
value = instance.OleObjects
IOleObjects OleObjects {get;}

Property Value

The OLE objects.
Remarks
This property is supported on Windows Forms, WPF, ASP.NET and ASP.NET MVC platforms only.
Example
The following code illustrates how to access the IListObjects collection in the worksheet to add a new IOleObject.
using Syncfusion.XlsIO;
using System.Drawing;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Create image stream
            Image image = 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();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also