Syncfusion.XlsIO.Base
Example 


Shape Property (IOleObject)

Gets or sets picture shape object that defines look and position of the OleObject inside parent worksheet.
Syntax
'Declaration
 
ReadOnly Property Shape As IPictureShape
'Usage
 
Dim instance As IOleObject
Dim value As IPictureShape
 
value = instance.Shape
IPictureShape Shape {get;}
Example
The following code illustrates how to set IShape.Height and IShape.Width of the Picture by accessing Shapes property.
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);
            
            //Set height and width
            oleObject.Shape.Height = 150;
            oleObject.Shape.Width = 150;
            
            //Save and dispose
            workbook.SaveAs("OLEObjects.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also