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
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 |
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 |
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 |
What is data driver in qtp?
what are all the fileds present in object repository?
how to generate numbers in between to numbers suppose numbers in between 500 to 1000 in sequencies using vbscript
what is the use of Browser.sync()
Hi, Plz give best Definition of Software Testing? Why we need Software Testing? and plz send 2+yrs experience Interview qutions (Manual,Qtp).
Hi, How Accessibility checkpoint in QTP can be implemented in the test script?
how to write scripts in QTP?
How to open an application through scripting?
When you are running a batch test of 5 scripts and in 2nd script appln crashed, what hpns then?
What are the types of object repositories? Which one is you using?
What are the recording modes in qtp?
What is Data driven Testing Frame work.Anybody can expain it in Detail.. Pls anybody can give the answer.. Thanks in advance...