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

How to recognise the webelement and verifying that webelement is enabled?

0 Answers  


How would you directly trigger javascript in a test?

0 Answers   eBay,


What are the key elements available in test result window?

0 Answers  


what r the executing modes in QTP

2 Answers  


Syntact for how to call one script from another? and Syntax to call one "Action" in another?

1 Answers  






Describe how Smart Identification is used

0 Answers  


normally by going through the object properties in object spy we write descriptive programming(correct me if i am wrong). But how or from where can we get the object properties in the object spy?plzzzzzz do answer

2 Answers  


hi i have 4 yrs exp in manual and automation testing using QTP i need sample resumes plz can u send this mail id pbre1980@gmail.com

0 Answers  


Is it possible to change the extension of Shared object repository?

2 Answers  


What is test fusion report?

2 Answers   CIL,


How many tables r created during the recording in QTP?

2 Answers  


setroproperty and getroproperty difference

5 Answers   Ordain Solutions,


Categories