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
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 |
I encountered with very strange problem in qtp while writing the script i written the code window"regexpwndclass:=XLMAIN").window"regexpwndtitle:=Open" ).Exit this code was working fine for about 10-15 times i executed the script but after some time qtp started giving the error with the same code the error is "Object doesnt support this method or function window(...).window(..)" then i modified the code with only window"regexpwndtitle:=Open").Exit in place of window"regexpwndclass:=XLMAIN").window"regexpwndtitle:=Open" ).Exit now again its working fine i cannot understand what thing is creating the problem if same code executed successfully in starting for about 10 times then why it is giving the error now can anyone give the reason .
What are the types of object repositories? Which one is you using?
How do you done Data-Driven Testing using MS-Word. What is the script for that
How can we export test results to an excel sheet in QTP??? Can any one provide sample coding for this?????
can any one tel ,using simple string a[0]=I a[1]=N a[2]=D like that it go's . . out put i need INDIA help me it's really need full ..
How to find the name of the machine where you are running your automation scripts in qtp?
How does QTP identifies the object in the application?
how to write regular expression for Date field?
Hi Friends... What you are doing in Regression Testing and how many test cases you ran in regression testing... suppose there is 1000 test cases is there how many test cases again you run .. 1000 test caes r how many... thanx in advance..
What are the different attribute used with regular expression?
want to learn real time automation project(QTP)?
what is the difference between modular framework & datadriven framework