fso.writeline not found

Posted on 2009-02-08
Medium Priority
Last Modified: 2013-12-08
Hi, I am trying to write a simple text file in VB6, using thr FSO.  I am using the code below (found in Experts-exchange).
The problem is that my oTS class doesn't have the Writeline (or Close) methods defined.  Am I using the incorrect reference?
I have included the Microsoft Scripting Runtime (scrrun.dll) in my references.

Thanks a lot
Dim ReportDir As String
        ReportDir = "C:\test"
        Dim oFSO As New Scripting.FileSystemObject
        Dim oTS As Scripting.File
        Dim strRetp As String
        Set oTS = oFSO.CreateTextFile(ReportDir & "\myfile.txt", ForWriting, True)
      '  oTS.WriteLine "text"
        Set oTS = Nothing

Open in new window

Question by:simb11
LVL 25

Accepted Solution

reb73 earned 200 total points
ID: 23585150
oTS should be declared as Scripting.TextStream

Author Closing Comment

ID: 31544302
Thank you, Reb73.  Thanks also for the fast response.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: You must have administrative privileges in order to configure lead or case queues. Salesforce.com (http://www.Salesforce.com) is a cloud-based customer relationship management (CRM) system. It is widely used around the world by sales and ma…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question