Micro Focus QTP (UFT) Forums

Full Version: Need to embed worksheet to already existing excel
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.

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. Smile

Regards,
Mahak
Do you want to move an excel worksheet from one excel(abc.xls) to another excel(xyz.xls)?