How to write image into Excel sheet

I want to insert picture at an specified cell in Excel

Page 1 of 1

3 Replies - 33964 Views - Last Post: 23 March 2008 - 07:00 AM Rate Topic: -----

#1 2piyusgupta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-February 08

How to write image into Excel sheet

Posted 20 February 2008 - 03:54 AM

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;

Is This A Good Question/Topic? 0
  • +

Replies To: How to write image into Excel sheet

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1639
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to write image into Excel sheet

Posted 20 February 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 :)
Was This Post Helpful? 0
  • +
  • -

#3 2piyusgupta  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-February 08

Re: How to write image into Excel sheet

Posted 20 February 2008 - 05:51 AM

View PostPsychoCoder, on 20 Feb, 2008 - 05:41 AM, said:

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 :)

actually this code is sufficient to write data into cell but
i want to do it for image so need help on...
Was This Post Helpful? 0
  • +
  • -

#4 sre08  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 23-March 08

Re: How to write image into Excel sheet

Posted 23 March 2008 - 07:00 AM

View Post2piyusgupta, on 20 Feb, 2008 - 03:54 AM, said:

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-inform...ert_picture.htm


http://vb.net-inform...7_tutorials.htm
Was This Post Helpful? 1

Page 1 of 1