Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error while opening text file through QTP
#4
Solved: 12 Years, 10 Months, 2 Weeks ago
Hi,
There are two mistakes in ur code
1. file - is a default keyword, it should not be used.
2. Instead of ForWriting you have to use number, ie - 2
Const 1 = ForReading, 2 = ForWriting, 8 = ForAppending

Try below code

Code:
Set fsoObj=createobject("scripting.filesystemobject")
Set Ofile = fsoObj.OpenTextFile("D:\bhim\one.txt",2,TRUE)
(06-14-2012, 04:13 PM)manabh Wrote: After set fsoObj=createobject("scripting.filesystemobject") verify fsoObj <> nothing
Reply


Messages In This Thread
RE: Error while opening text file through QTP - by ssvali - 06-14-2012, 04:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to read a text file using FSO from bottom to up order?? vallalarasu.p 0 2,829 10-13-2014, 11:14 AM
Last Post: vallalarasu.p
  how to create text file swayam 1 3,266 05-29-2014, 01:25 PM
Last Post: basanth27
  Retrieving Text from a PDF file smartkarthi 2 5,272 08-22-2013, 11:44 AM
Last Post: smartkarthi
  Cannot attach the text file to email arpan 2 3,914 07-19-2013, 12:13 AM
Last Post: arpan
  Read text from text file and save it into a variable in qtp arpan 3 14,006 06-19-2013, 08:34 PM
Last Post: arpan

Forum Jump:


Users browsing this thread: 1 Guest(s)