I am having troble opening a text file for TextStream:
Private Function OpenFile(What As String)
Dim fso As New FileSystemObject, fil1 As File, ts As TextStream
Set fil1 = fso.GetFile(What)
' Read the contents of the file.
Set ts = fil1.OpenAsTextStream(ForReading)
s = ts.ReadLine
MsgBox s
ts.Close
End Function
This is basically a little bit of the code for what im doing. The problem im having is User Defined type not found. What am I doing wrong?
Thanks
Able
P.S. - What can I do if I want to read a specific line?
Private Function OpenFile(What As String)
Dim fso As New FileSystemObject, fil1 As File, ts As TextStream
Set fil1 = fso.GetFile(What)
' Read the contents of the file.
Set ts = fil1.OpenAsTextStream(ForReading)
s = ts.ReadLine
MsgBox s
ts.Close
End Function
This is basically a little bit of the code for what im doing. The problem im having is User Defined type not found. What am I doing wrong?
Thanks
Able
P.S. - What can I do if I want to read a specific line?