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

How to Get the Run-time value of an object under that web app under Test to the local data table sheet of that Action?

3596


How to analyzing the checpoint results?

522


How do you delete unwanted results in qtp?

604


What is test object model in quicktest professional (qtp)?

549


what are all the fileds present in object repository?

1563






Why qtp the best testing tool?

566


How will you declare a variable in qtp?

556


Where to use function or action?

669


How reliable are the site's Internet connections required to be? And how does that affect backup system or redundant connection requirements and testing?

702


can any body clearly explain about keyword driven framework .give me the explanation for files what ever you use in this frame work?

1692


Explain the differences between table and db checkpoints?

583


What is the difference between rational rose and QTP?

1782


What are the different kinds of test steps?

574


What is active screen?

564


what is supply chain management?

2091