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 the automated tests in org

1 Answers   Maintec,


Give me some scripts for 1). checking webpage links (counting links,opening web pages,counting child elements)

2 Answers   CIL,


When I used random numbers(1 to 9) with regular expression and run the test, it runs only 5 iterations with passed result instead of running all 1 to 9. Please tell me what can be the reason

0 Answers  


what is stepin & stepout?

0 Answers  


How do you test siebel application using qtp?

2 Answers  


What is keyword view?

0 Answers  


If some requirements r changed during the testing process ,then how can u handle this in frame work?

1 Answers  


how to get font size of a "WebEdit"

3 Answers   L&T,


i'm using QTP 8.2. A person using QTP 9.0 sends me a QTP TestScript, same when i try to open , an error comes "unexpected file format". Why?? and how to resolve the problem??

2 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,


How will u declare a variable to access multiple actions? a)Dim b)Global c)Public d)Private

1 Answers  


What are the check points can be inserted without recording?

0 Answers  


Categories