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

What is system testing and what are the different types of tests you perform in system testing?

0 Answers  


In a web application , there is a table of rows and coloums , i want to pickup the 1st row and 3rd coloums name (not data)how can any one explain

5 Answers   Polaris,


what is use of optionexplicit in variable declaration

5 Answers   GE,


Which statement will use for close an action in QTP?

0 Answers  


.how will you load the object during runtime

2 Answers   TCS,






In Test Director bug rEPORTS, wHAT ARE THE CONTENTS(fIELDS)? iF yoU PREAPARE BUG REPORT IN eXCEL sHEET , hOW U SEND TO dEVELOPMENT TEAM THRW T.D?

1 Answers  


I have 3 add buttons of same properties in my page but i want trigger one of them i required in my recovery scnario manager is qtp recognizes it to recovre d scnario if so how qtp recognizes it

3 Answers  


What all challenges you have faced during automation and how you have resolved it?

2 Answers   Genpact,


how to capture objects of remote deskop as it is capturing only window.

1 Answers   Wipro,


In smart identification, explain about 1. Base filter properties 2. optional filter properties with examples?

2 Answers   TCS,


can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?

0 Answers  


The structure of keyword driven frame work is like a folder structure the different sub folder are 1-functional libray folder 2-object repository folder 3- database folder 4-appliction1.xls 5-initalzation vbs file 6-sequence file 7-driver script 8-test case list file My question is whether these are in a local server machine or in our pc.((whether It like Vss). can u give example of driver script(code)

0 Answers   TCS,


Categories