We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to insert an Image in XlsIO?

Platform: WinForms |
Control: XlsIO |
Published Date: April 30, 2011 |
Last Revised Date: May 27, 2021

Syncfusion XlsIO supports adding pictures/images into Excel document. The following complete code snippet explains this.

C#

using (ExcelEngine excelEngine = new ExcelEngine())
{
    IApplication application = excelEngine.Excel;
    application.DefaultVersion = ExcelVersion.Excel2016;
    IWorkbook workbook = application.Workbooks.Create(1);
    IWorksheet worksheet = workbook.Worksheets[0];
 
    worksheet.Pictures.AddPicture(1, 1, "../../Image/AdventureCycle.png");
 
    workbook.SaveAs("Output.xlsx");
    System.Diagnostics.Process.Start("Output.xlsx");
}

 

VB.NET

Using excelEngine As ExcelEngine = New ExcelEngine
    Dim application As IApplication = excelEngine.Excel
    application.DefaultVersion = ExcelVersion.Excel2016
    Dim workbook As IWorkbook = application.Workbooks.Create(1)
    Dim worksheet As IWorksheet = workbook.Worksheets(0)
 
    worksheet.Pictures.AddPicture(1, 1, "../../Image/AdventureCycle.png")
 
    workbook.SaveAs("Output.xlsx")
    System.Diagnostics.Process.Start("Output.xlsx")
End Using

 

A complete working sample can be downloaded from InsertImage.Zip.

Take a moment to peruse the documentation, where you can find basic worksheet data manipulation options along with features like Conditional Formatting, worksheet calculations through Formulas, adding Charts in worksheet or workbook, organizing and analyzing data through Tables and Pivot Tables, appending multiple records to worksheet using Template Markers, and most importantly PDF and Image conversions with code examples.

Refer here to explore the rich set of Syncfusion Essential XlsIO features.

Note:

Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, include a license key in your projects. Refer to link to learn about generating and registering Syncfusion license key in your application to use the components without trail message

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile