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 qtp identifies objects of application.

5 Answers   Intel,


hi i have one isuue on selecting webcheckbox .there are 15 wecheckboxex i want to select every time 9 th one how can i select plese help me regards balaji

4 Answers  


I have two For loop, first For loop does is creates a customer and input the customer info and then the second for loop within the first for loop does the follows which is capture the customer name and verify the with the data within the datatable. The problem I am coming across is that when it goes through the second time creating another customer and then verify the second customer then it creates the following during runtime. I want is to have the customer2 below Customer1 under the Customer_from_Apps. Any help will be greatly appreciate it. Customer Customer_from_Apps Customer_from_Apps1 Customer1 Customer 1 Customer2 Customer2 Window("Customer Desktop").Window("Customer Tracking (Privacy").WinObject("TreeView20WndClass").Click 92,244 runtimevalue = .VbTreeView("vbname:=AppServerTree").GetROProperty("Selectio n") Customer_Val= Datatable.GlobalSheet.AddParameter ("Customer_from_Apps",runtimevalue) row=datatable.getsheet("Global").GetRowCount For x=1 to row datatable.SetCurrentRow(x) Data_Val=Datatable.Value("Customer",dtGlobalSheet) If (trim(Customer_Val)=trim(Data_Val)) Then Reporter.ReportEvent micPass, "Customer validation successful", "Actual Value: " &Data_Val&vbcrlf& "Customer Value: " &Customer_Val else Reporter.ReportEvent micFail, "Cusotmer validation unsuccessful", "Actual Value: " &Data_Val&vbcrlf& "Customer Value: " &Customer_Val End If Next

0 Answers  


After the execution of a script how do u upload the results to Quality Center. Pls anyone explain in detail. It is very urgent._______Thanks a lot!!

2 Answers   ABC,


What is LoadRunner?

1 Answers   Crea,


hi in QTP 8.2 in the edit box has text like "raju want married" . i want to check "want" is their in the text or not ?

16 Answers   Syntel,


what is keyword driven testing in qtp?n how is it useful?

0 Answers  


HI. Plz Clarifie my doubt,having 2+yrs experience in Testing , But My accedamics(Xth,INTER) are Less than 60%, But B.Tech 72%. It creats any problem , When i change to any MNC. plz tell me......... lot of friends told it's a problem, Some people says NO problem, What .............

3 Answers  


Hi Friends, Im planning to do certifcation in mercury Automation Tool QTP.But I Didnt get any clear details regarding course syllabus, fees, where to approach, and which certification would be useful for the experienced testers? can any one send me the details?

0 Answers  


3 differences between QTP & Winrunner?

1 Answers  


can u expect, major bugs in NET BANKING Project? Modules Transaction Module, Customer Relation Module.

2 Answers  


need clear explanation of actions and functions in qtp with examples?can anyone suggest me gud site for that other than qtp manual?

2 Answers  


Categories