i have .xls,.txt,.doc files are there (together). i want
find only .xls file among them? how can we write function?

Answer Posted / uday kumar_anem

Hi,

Please try with this script:

Set fileSysObj=CreateObject("Scripting.FileSystemObject")
folderPath="D:\"
If fileSysObj.folderexists(folderPath) then
Set fileObj=fileSysObj.getfolder(folderPath)
Set fileObjs=fileObj.files
For Each FileName In fileObjs
If FileName.type="Microsoft Excel Worksheet" then
MsgBox("This is the excel file "&FileName.Name)
End if
next
else
MsgBox("Folder does not exist")
End if

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is throw object?

2036


Explain the benefits of quick test pro(qtp)?

781


When ‘option explicit’ keyword is used in qtp?

977


Why script error occur in between recording in qtp?

2004


if numbers are always changing write a script for that

3789


What are the two types of repositories available, explain them?

814


WHAT IS THE DIFFERENCE BETWEEN QTP SCRIPT AND VB SCRIPT? HOW MUCH PERCENTAGE WE USE IN QTP SCRIPT REAL TIME AND HOW MUCH PERCEN OF VB SCRIPT,,,,,,,

1770


What is Port testing. Whhen will you perform?

1722


Give me At Least 5 Differences between DOCUMENTATION OBJECT MODEL(DOM)and COMPONENT OBJECT MODEL(COM)? Interviewer said me to WRITE the difference only in points not as you WRITE a paragraph ???? only in points

1897


Does QTP run in any environment?

842


Subj: realtime example of Database check point, Can any one please detail on how the Database check point is utilized/implemented in a real time project. I already know how to make one by creating DSN/ODBC and writing the required query manually and other steps...I wanted the actual concept of implementation...couple of live examples will be highly appreciated. Thank you in advance

2012


What are the different types of checkpoints?

809


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

1695


How the exception handling can be done using quicktest professional?

781


Shall we add Local Repository to shared object repository,if yes,how we add

6686