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 |
can we call a test in another test?
in qtp wha t is synchronisatin pt,what is the maximam time out
Write the Test Cases for ATM(Any Time Money)
What are associated files in QTP?
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++ )
Hi frnds, does anybody know if there is anything called "thin point" or something in qtp? thanks in advance.
Please provide specific examples of advanced/creative usage of QTP, including how impact & benefits for your project
how to automate standalone infopath forms using QTP? (it is not a dotnet or a web form)
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
how to test load test and block box testing an a web based application pls give ans briefly
write code to read and write data from file?
What is the use of Regular expression?