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

Mention the different actions types of qtp.

0 Answers  


explian about the qtp frame work? where u can use it in your project?

1 Answers  


we have 10 actions in out test how can we convert 9th action is main action ? how ?

5 Answers  


How to retrive the property of an object?

5 Answers  


How can we redirect QTP results in to a excel sheet after the execution

3 Answers   SAP Labs, Virtusa,






how to test a java project throughqtp?while testing a vb project we generally do vb scripting. but while testing java project do we use java script .plz some one can send me the manual for it my email roy_samata@yahoo.com thanks in advance

1 Answers  


Hi I know two types of testing processes. 1. Reaquirments stage,test design,code review's, Design review's, Test Plan, Test Cases design, test execution, Defect Reporting and tracking, UAT, Signoff. 2.Test Initiation , Test Plan, Test Design, Execution,Bug tracking, UAT, Sign off.

0 Answers  


i have written some lines of code today..tommorow some lines of code deleted in middle of that code..how to handle this type of script

1 Answers  


After executing the script in qtp suppose i found some script execute successfully and found some error.So how to report the status for both (i.e pass and fail report)in test director. For "fail" We use "defect tab" in testdirector. But for "pass" how to report it to TL.what is the process plz anybody ans

0 Answers   TCS,


An object is non standard object, i mapped it to standard object, eventhogh on mapping to standard object i cannot use the methods available on the standard object with the mapped object. How i can use those standard object methods with these mapped object. (((Note : dont tell that we can use virtual object as virtual object is to map nonstandard obj to standard obj)))

0 Answers   HCL,


how do u prepare Test Environment ?

1 Answers  


what is framework and types of framework? Need of framework in automation? write folder strucuture of framework.

3 Answers   HealthAsyst,


Categories