Micro Focus QTP (UFT) Forums
Need to embed worksheet to already existing excel - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Need to embed worksheet to already existing excel (/Thread-Need-to-embed-worksheet-to-already-existing-excel)



Need to embed worksheet to already existing excel - mahaktikoo - 09-14-2012

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


RE: Need to embed worksheet to already existing excel - krr - 09-27-2012

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