Welcome to Dream.In.Code
Become a C# Expert!

Join 150,381 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,388 people online right now. Registration is fast and FREE... Join Now!




How to write image into Excel sheet

 
Reply to this topicStart new topic

How to write image into Excel sheet, I want to insert picture at an specified cell in Excel

2piyusgupta
20 Feb, 2008 - 02:54 AM
Post #1

New D.I.C Head
*

Joined: 15 Feb, 2008
Posts: 2

CODE
Excel.Application oAppln = new Excel.Application();
            Excel.Workbook oWorkBook = (Excel.Workbook)(oAppln.Workbooks.Add(@"D:\work\abcd.xls"));
            Excel.Worksheet oWorkSheet = (Excel.Worksheet)oWorkBook.ActiveSheet;
            oWorkSheet.Cells[1,1] = img;

User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: How To Write Image Into Excel Sheet
20 Feb, 2008 - 04:41 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Are you getting an error, if so what exactly is the error? We need more information in order to properly help you, like is this code working, if not what is it doing, information like that smile.gif
User is offlineProfile CardPM
+Quote Post

2piyusgupta
RE: How To Write Image Into Excel Sheet
20 Feb, 2008 - 04:51 AM
Post #3

New D.I.C Head
*

Joined: 15 Feb, 2008
Posts: 2

QUOTE(PsychoCoder @ 20 Feb, 2008 - 05:41 AM) *

Are you getting an error, if so what exactly is the error? We need more information in order to properly help you, like is this code working, if not what is it doing, information like that smile.gif

actually this code is sufficient to write data into cell but
i want to do it for image so need help on...

User is offlineProfile CardPM
+Quote Post

sre08
RE: How To Write Image Into Excel Sheet
23 Mar, 2008 - 06:00 AM
Post #4

New D.I.C Head
*

Joined: 23 Mar, 2008
Posts: 1

QUOTE(2piyusgupta @ 20 Feb, 2008 - 03:54 AM) *

CODE
Excel.Application oAppln = new Excel.Application();
            Excel.Workbook oWorkBook = (Excel.Workbook)(oAppln.Workbooks.Add(@"D:\work\abcd.xls"));
            Excel.Worksheet oWorkSheet = (Excel.Worksheet)oWorkBook.ActiveSheet;
            oWorkSheet.Cells[1,1] = img;



for adding picture

xlWorkSheet.Shapes.AddPicture("C:\xl_pic.JPG", _
Microsoft.Office.Core.MsoTriState.msoFalse, _
Microsoft.Office.Core.MsoTriState.msoCTrue, 50, 50, 300, 45)

check this link

http://vb.net-informations.com/excel-2007/...ert_picture.htm


http://vb.net-informations.com/excel-2007/...7_tutorials.htm



User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 03:35PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month