Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

Dim ts As TextStream

Hi,

I am having an error if I declare ts as textStream

and  Dim fso As New FileSystemObject

do I have to import something in order to user
textStream and FileSystemObject?

the error says

user-defined type not defied.

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Shanmuga Sundaram D
Shanmuga Sundaram D
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
shasunder showed how to do it with early binding.  With late binding...



Dim fso As Object
Dim ts As Object

Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.CreateTextFile("c:\folder\subfolder\text.txt", True)
'Set ts = fso.OpenTextFile("c:\folder\subfolder\text.txt")
Avatar of lulu50

ASKER

   

I have an error that says Sub or Function not defined

it is pointing on the ExecCmd  any idea what's going on?

 ExecCmd "\\Hudson\aas\AASProj\GE\DATA\DOWNLOAD\GEDecryptEncrypt\GEDecrypt.bat"
Avatar of lulu50

ASKER

Thanks,