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 area in a web application cannot be automated.
what does it mean when a check point is in red color? what do u do?
i've installed qtp9.2 on Windows 7. Recording and everything no problem. But when i am saving the test, it is not happening. it says 'general error while saving'. But teh test is getting saved but as a folder with lock icon. When i wanted to open it, it is jst showing as a locked folder but not as a test. Somebody help me out plz
Hi PLZ explain User Defined Functions in QTP with eample?
how to write code for to select all the checkboxs in the gmail i wrote code for my question but it didn't works any body suggest what wrong my code my code is Set chkboxDesc=Description.Create() chkboxDesc("type").value="chekbox" Set chboxcollection=Browser("name:=Gmail .*").Page("title:=Gmail .*").ChildObjects(chkboxDesc) For i=0 To chboxcollection.count-1 chboxcollection(i).set "ON" Next i was getting general run time error pls help me i am in learing stage
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
after initiating one project for testing, when exacltly QTP tester role starts?
can any one please tell me which is the best institute in Bangalore to learn QA (crash course)? Thanks
what difference between client and server applications exatly?
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++ )
what is the criteria for choosing test cases for automation? Ex: if you have some 300 test cases, then how many you choose for automation. what is criteria of selecting?
3 Answers Aricent, Delhi University, TCS,
Write script to fetch the data from global sheet where row number is 3 and parameter is "text"
3 Answers Accenture, Thomson Reuters,