07-27-2008, 01:20 AM
Hi
I am a QTP beginner.
I wrote some code for file handling and I receive the error message saying "Invalid procedure call or argument" at line 8.
The code is below:
Can anybody please help me?
Thank you
I am a QTP beginner.
I wrote some code for file handling and I receive the error message saying "Invalid procedure call or argument" at line 8.
The code is below:
Code:
Dim fso1,file1,file1location
file1location = "c:\textfile.txt"
Set fso1 = createobject("scripting.filesystemobject")
Set file1 = fso1.createtextfile(file1location,true)
file1.write("This is Usha")
file1.write("Rani")
file1.close()
'The error is coming at the following line
Set file1 = fso1.opentextfile("c:\textfile.txt", ForReading, True)
Do while file1.AtEndOfStream<>true
msgbox file1.readline()
Loop
Thank you