if the excel sheet specified in script is not there,we get
run time error how to handle the error ,please anybody
explain me in detail

Answer Posted / veeranki naveen

On error resume Next
err.clear
set Excl = createobject("excel.application")
set Workbook=Excl.Workbooks.open("C:\Folder\ExcelFile.xls")
if err.number <> 0 then
msgbox "Excel Sheet is not present at the specified path"
End If


OR


set fso = createobject ("scripting.filesystemobject")

bol = fso.fileexists ("C:\Folder\ExcelFile.xls")

if bol = false then

msgbox "Excel Sheet is not present at the specified path"

End If

msgbox

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between the modular framework and datadriven frame work

2097


If a button named "CLICK" is recorded in low level recording mode , what will be the values stored for "name" property of that button in object repository ?

1927


Will down time for server and content maintenance/upgrades be allowed? how much?

805


in data driven testing for performing operations which method is easy from manual test data,keyword view,or from database.and why?

1536


Explain quicktest professional testing process?

712






How to get popup error message.

1193


please post the interview questions for QA position in FACTSET

4139


Please guide me release notes of Automation once scripts are completed

1612


How to call a test from another test?

904


can any boby tell me what is method or steps to connect the remote desk top by using QTP 9.2 version?

1769


How to execute a winrunner script in quicktest professional?

728


Suppose I have three hyperlinks with same properties. How to solve this and what are the ways to solve this. we can solve this by using index property but what are the other ways we have have to solve this problem. Login (href: btnlogin.aspx) Login (href: Sourcelogin.aspx) Login (href: homelogin.aspx)

1732


There is an built in window application in qtp9.1,i.e.Flight4.0.i want to implement the recovery maneger on it.How can i do this?

1784


what are the challenges you have faced while testing web based application using the automation tools ?

793


what is review

1823