Syncfusion.XlsIO.Base
Example 


HasOleObject Property

Gets whether the OLE object is present in the worksheet. Read-only.
Syntax
'Declaration
 
ReadOnly Property HasOleObject As Boolean
'Usage
 
Dim instance As IWorksheet
Dim value As Boolean
 
value = instance.HasOleObject
bool HasOleObject {get;}

Property Value

True if this instance is OLE object; otherwise, False.
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;
using System;
            
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);
            
            //Check HasOleObject
            Console.Write(worksheet.HasOleObject);
            
            //Save and dispose
            workbook.SaveAs("OLEObjects.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//True
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also