Syncfusion.XlsIO.Base
Example 


Name Property (IOleObject)

Gets the name of an OLE object.
Syntax
'Declaration
 
ReadOnly Property Name As String
'Usage
 
Dim instance As IOleObject
Dim value As String
 
value = instance.Name
string Name {get;}
Example
The following code illustrates how to access Name property.
using Syncfusion.XlsIO;
using System;
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);
            
            //Get name
            Console.WriteLine(oleObject.Name);
            
            //Save and dispose
            workbook.SaveAs("OLEObjects.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//Picture0
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also