I am having trouble using the WriteLine method to write out to a textstream:
The code is as follows:
Global gFSO as New FileSystemObject
Global gtsLog as TextStream
In a different module:
Private Sub A()
...
Set gtsLog = gFSO.OpenTextFile(<path>, ForAppending, True, TristateFalse)
gtsLog.WriteLine ("some text") '<== No problem here
...
End Sub
Private Sub B()
...
gtsLog.WriteLine ("more text") '<== Error message
...
End Sub
The error message reads:
Object variable or With Block not set.
This has happened twice in two unrelated programs I have been working on over the last week, where am I going wrong?
Any ideas?
Steve.
The code is as follows:
Global gFSO as New FileSystemObject
Global gtsLog as TextStream
In a different module:
Private Sub A()
...
Set gtsLog = gFSO.OpenTextFile(<path>, ForAppending, True, TristateFalse)
gtsLog.WriteLine ("some text") '<== No problem here
...
End Sub
Private Sub B()
...
gtsLog.WriteLine ("more text") '<== Error message
...
End Sub
The error message reads:
Object variable or With Block not set.
This has happened twice in two unrelated programs I have been working on over the last week, where am I going wrong?
Any ideas?
Steve.