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

Output values? i want a practical example

1304


What is Unicode Compatibility?

1445


Please provide specific examples of advanced/creative usage of QTP, including how impact & benefits for your project

1630


Suppose I have three hyperlinks with same properties. How to solve this and what are the ways to solve this. we can solve this by using index property but what are the other ways we have have to solve this problem. Login (href: btnlogin.aspx) Login (href: Sourcelogin.aspx) Login (href: homelogin.aspx)

1545


Limitations in QTP?

1735






how to do the batch testing in test director using manual testing procedure?

1771


your coming from electrical backgroung..but y ur coming to software side?

1378


How qtp recognizes the object?

663


Can we use index on view?

1593


wht type of User defined functions or Java Releated functions do we write in VB scripting

1817


What is the script for database check point, bitmapchek point, regular expression ?

1544


How will you declare a variable in qtp?

546


Why we load add-ins in qtp?

622


An action has both shared and local or associated to it and both have the same object in them. In the test which one will be considered?

648


What is fragmentation and paging?

1585