Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to insert picture in excel cell
#1
Solved: 10 Years, 9 Months, 2 Weeks ago
Hi,

I can take a screen shot using qtp. How can i insert the image in excel cell or range of cells?

This code below take the screenshot and works:

Code:
Dim path_error_file
path_error_file = "C:\Documents and Settings\msafiullah\Desktop\\error.bmp"
Desktop.CaptureBitmap path_error_file,True


This code in below i used to insert the picture into excel cell(or range) but it does not work.

Code:
Set Obj = CreateObject ("Excel.Application")    'Pass
Obj.Visible = True      'Pass

Set objWorkbook1 = Obj.Workbooks.Open("C:\Documents and Settings\msafiullah\Desktop\Book18.xls")     'Pass


range("B9").Select      'Pass

Obj.objWorkbook1.objWorksheet1.Pictures.Insert("C:\Documents and Settings\msafiullah\Desktop\error.bmp") 'Fail


Someone pls help me. Thanks.

Safi
Reply


Messages In This Thread
How to insert picture in excel cell - by bangla123 - 10-21-2010, 02:28 AM
RE: How to insert picture in excel cell - by KVK - 10-26-2010, 02:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Add picture to Excel From UFT eiko 0 1,709 02-10-2018, 12:39 AM
Last Post: eiko
  How import final calculated values by cell formula from Excel not the formula itself. qtped 1 4,720 01-17-2017, 04:05 PM
Last Post: sagar.raythatha
  Unable to insert data into datatable Prashanth 1 3,472 05-10-2013, 03:07 PM
Last Post: Saket
  insert call to new action bistritapcv 1 2,461 04-06-2013, 12:09 PM
Last Post: ravi.gajul
  how to insert error msg in a datatable using Dp? zakshah.12 0 1,886 03-05-2013, 07:49 AM
Last Post: zakshah.12

Forum Jump:


Users browsing this thread: 1 Guest(s)