Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application, both ASP.NET web sites and Windows Forms application.

Sun Sep 23, 2007 12:03 pm

Hi,

Spire.XLS is so powerful, a great component.
I have a question , how to add a image to excel document?

Thankyou,

Democrat

MichealRike
 
Posts: 1
Joined: Sun Sep 23, 2007 11:55 am

Sun Sep 23, 2007 12:12 pm

Hello,

Thank you for interesting in our product.

Try to using following code,

Code: Select all
Workbook workbook = new Workbook();
Worksheet sheet = workbook.Worksheets[0];

sheet.Pictures.Add(1,1,@"..\..\..\..\..\..\Data\day.jpg");

workbook.SaveToFile("sample.xls");
User avatar

Flash
 
Posts: 56
Joined: Thu Jun 29, 2006 2:34 pm

Return to Spire.XLS