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 recovery scenario in qtp?

577


Why do we use breakpoints in QTP?

574


What is the extension of qtp local repository?

568


if there is a web table of having row and colmns.a button is placed at 2nd row's 3rd column which is worked for both edit and delete..how to write script for the button to test both operation on the web table using desriptive programing.. plz help me on script wheather using getroproperty Q2)what is the command for taking valiue from a web table in qtp

23891


How many add-ins comes by default with quicktest professional (qtp)?

554






What are the general steps involved in the data driven framework?

548


Where to use function or action?

664


In qtp, explain what is keyword driven automation framework?

609


wht type of User defined functions or Java Releated functions Do we write in VB scripting

1374


i need to add 1000 users in a domain i written the script for that and it is running successfuly but the problem is that my system is not the user of that domain in which i have to add users so for adding users in that domain i have to install qtp on that another system, can anybody suggest me the way to add those users from my system ultimately i want to know how to access remote computer through script

1410


What is the Difference between copy to action and call to action?

574


what is clean sweep?

1508


For which type of project the iterative model is suitable?

1372


What is the extension of the qtp local repository? If it is .mtr then what is .bdb extension stands for?

563


i am looking job in perfomance testing using Loadrunner any one help me a project plz......?(Chandana) chs_29@rediffmail.com

1454