Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error message

Status
Not open for further replies.

Stephon98caffe

Programmer
Feb 18, 2005
25
US
Is there something wrong with this code? I get this error message.

' VB Script Document

Dim objFile, strGuyFile, strFilePath

strFilePath = "c:\temp\outofdate.txt"
'opens file
Set objFile = CreateObject("Scripting.FileSystemObject")

'****Invalid procedure call or argument****
Set strGuyFile = objFile.OpenTextFile(strFilePath, True,false)

do while not strGuyFile.AtEndOfStream
line = strGuyFile.ReadLine
Wscript.Echo line
loop



strGuyFile.Close
 
>Set strGuyFile = objFile.OpenTextFile(strFilePath, [red]True[/red],false)
Red 2nd parameter is 1 (read), 2 (write) or 8 (append). true is practically -1 for vb(s) (vbtrue=-1). Change the value to either one of them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top