10-21-2010, 02:28 AM
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:
This code in below i used to insert the picture into excel cell(or range) but it does not work.
Someone pls help me. Thanks.
Safi
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