Suppose there is a link present somewhere in an excel sheet.
Find the link and click on it. How to write a script using
Excel application object in QTP?






Suppose there is a link present somewhere in an excel sheet. Find the link and click on it. How to..

Answer / anup muralidharan nair

'Assume the link present in excel that you want to click is
'www.google.co.in

set oxls = createobject("excel.application")
set obook = oxls.workbooks.open("D:\excel.xls")
set osheet = obook.worksheets("sheet1")

'Retrieve all the hyperlinks within the sheet
set ohyper = osheet.hyperlinks
for each hyp in ohyper
If hyp.name = "www.google.co.in" Then
hyp.follow
End If
next

'close the book and release the excel object
obook.close
set obook = nothing
set oxls = nothing

Is This Answer Correct ?    4 Yes 0 No

Post New Answer




More QTP Interview Questions

difference between recording methods and recording modes in QTP

5 Answers   Ordain Solutions,


Dear All, How to generate Pass or Fail Report in QTP without using Reporter.Report Event Method ? Thanks Balaji

0 Answers   TCS,


Can we write class for vb script in Quick Test Professional?

2 Answers   JPMorgan Chase,


Can you import and export data from XLS and how?

4 Answers  


What is recovery scenario manager? When you go for recovery scenario manager?

0 Answers  






There r 1000 rows and 1000 coloums , in that I want pickup a name of the coloumn , pls dont say in sql statements , in interview one of the interviewer said it was a wrong answer pls any send me answer its urgent

1 Answers  


What is the condition or scenario that leads the use of object spy in qtp? (while recording we can get all the properties) then wat leads to use this?

2 Answers   iSoft,


Hi All, I have QTP installed on my machine but the application under test (AUT) is on remote desktop.My scenarios is like that,it should contain following steps. 1)Automatically it should click on start and then on remote desktop connection. 2)it should enter the IP address and then connect to remote desktop. 3)and then it should be able to record the application in remote machine and then run it also. Can somebody tell me how to record the application which is in remote machine.

0 Answers  


How can I pass values from one action to another in QTP ?

8 Answers   Ordain Solutions,


How to capture a window in qtp or how to take snapshot of any window while writing script in qtp

3 Answers  


what testing activities u may want to automate?

2 Answers  


what is the another name for blackbox testing?

7 Answers  






Categories