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 |
In project module it contains 3-ok buttons with same properties who qtp identify its objects while runing ??
how to upload an excel sheet to quality center?
How does Parameterization and Data-Driving relate to each other in QTP?
How we can use the database checkpoint on a java web based application in which the database connectivity is done using JDBC->Pure Java type (in this type there is no need to create a DSN). At present in QTP we can fetch database values using checkpoint only through DSN. Is there any programming for this if we don't have DSN (ODBC)
Some time when i wanna learn the object i face issue like i am not able learn the object in proper manner... eg:for text bo on web page it should learn as webedit but some times it reads as winobject:internetexpoler-server, because of this i have to uninstall the qtp and re-install it again when i do this it reads the object perfectly.....plz suggest the soln
hi,which is the best book to refer QTP 9.2 and Faq's.
how u will describe testing activities?
How to fetch web elements count from Google Page which contains letter "e"
i want click on a link which is in 3rd row and 2nd column of a web table.write script to execute
What is clean sweep?
how can we preform retesting(DATA driven test) using function please gine the code for loginpage
What is the limitation to XML Checkpoints?