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

Answers were Sorted based on User's Feedback



if the excel sheet specified in script is not there,we get run time error how to handle the error ..

Answer / rayudu

Use on error resume next

Is This Answer Correct ?    3 Yes 1 No

if the excel sheet specified in script is not there,we get run time error how to handle the error ..

Answer / 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

More QTP Interview Questions

How to use transactions in qtp?

0 Answers  


object types is used for what?

1 Answers  


hi this is srinivasa(from blr) i complited my B.tech(e.c.e) in 2007 im searching job in s/w testing but idont have freshers resume for s/w testing please send some s/w testing resume for me(fresfers resumes only) advns thnks you

2 Answers  


If the web applicatoin takes navigation time above 2 hours to dispaly next Web page then how can we synchronize the QTP with Appilication Under Test

4 Answers   TCS,


What is the difference betweent test and component?

1 Answers  






How to find given string is palindrome or not without using strreverse() function?

2 Answers  


How can i select multiple values from drop down list using vb script in qtp? and wt is the script for clicking msg box box automatically with a specific time. Thanks in advance...Kalyani.

2 Answers   Accenture, CSC,


How to create Userdefined Function.Please write the steps ans also provide example where exatcly we use it.

1 Answers   HP,


how to find that tools work well with ur existing system?

0 Answers  


What is Description Object?

1 Answers  


I have one question as HP QTP is concern, Please send your answers..... Can we do testing of any application without using any of the framework which are we used in QTP tool. If yes then how it can be possible in the HP QTP tool. -- Regards

5 Answers   ABC,


Flight reservation using input and output parameter script.

1 Answers  


Categories