Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

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

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

Answer / ramchandra patil

Hi,

@Uday Kumar perfect code...its working perfect

Thanks Uday Kumar..



Ramchandra Patil
9699851282

Is This Answer Correct ?    0 Yes 0 No

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

Answer / kamesh

using the extention (.xls) in code..see below code
Here i open the file from mentioned path and read and write
the values on that.


Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\DIM.txt", 1, True) ' open to
empty file and also use for open the file which is already
created
WriteLineToFile = f.ReadAll 'Read all the file line to
line
msgbox WriteLineToFile

Set MyFile1 = fso.CreateTextFile
("c:\kamesh.txt",True) 'create new empty file
MyFile1.WriteLine WriteLineToFile ' Write all the stuf
in created file
MyFile1.Close

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More QTP Interview Questions

can we call a test in another test?

3 Answers   iFocus,


in qtp wha t is synchronisatin pt,what is the maximam time out

3 Answers  


Write the Test Cases for ATM(Any Time Money)

3 Answers   SpaceLabs,


What are associated files in QTP?

2 Answers  


Hi im new in Testing..can any one plz re-write this code SystemUtil.Run "C:\Program Files\Mozilla Firefox\firefox.exe","","C:\Program Files\Mozilla Firefox","open" ----using for loop(for i=0;i<=10;i++ )

2 Answers  


Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.

1 Answers   scintel,


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

0 Answers   T Mobile,


how to automate standalone infopath forms using QTP? (it is not a dotnet or a web form)

1 Answers   ABC,


Hi experts. I want to create a framework for the Flight Reservation sample application.Can anybody tell me the files and the contents , and how to create them.Thanks

2 Answers   IBM,


how to test load test and block box testing an a web based application pls give ans briefly

0 Answers   Impiger,


write code to read and write data from file?

1 Answers   IBM,


What is the use of Regular expression?

5 Answers  


Categories