09-14-2012, 04:19 PM
Hi guys,
I am trying to embed worksheet to already existing excel using vb script in QTP.
I am using the same script that adds pictures, but this doesnot seem to work.
Can anybody help me out here. Thanks in advance.
Regards,
Mahak
I am trying to embed worksheet to already existing excel using vb script in QTP.
I am using the same script that adds pictures, but this doesnot seem to work.
Code:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWB = objExcel.WorkBooks.Open("C:\test.xlsx")
Set objWS = objWB.Worksheets(3)
objExcel.ActiveCell.Worksheet.Pictures.Insert("C:\img\abc.jpg")
objWB.Save
objExcel.Quit
Can anybody help me out here. Thanks in advance.
Regards,
Mahak