Syncfusion.XlsIO.Base
Example 


Location Property (IOleObject)

Gets or sets the location.
Syntax
'Declaration
 
Property Location As IRange
'Usage
 
Dim instance As IOleObject
Dim value As IRange
 
instance.Location = value
 
value = instance.Location
IRange Location {get; set;}

Property Value

The location.
Example
The following code illustrates how to set the Location 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;
            
            //Set location
            oleObject.Location = worksheet["C7"];
            
            //Save and dispose
            workbook.SaveAs("OLEObjects.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also