Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Dim ts As TextStream

Posted on 2009-05-12
4
Medium Priority
?
795 Views
Last Modified: 2013-11-28
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,
0
Comment
Question by:lulu50
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
Shanmuga Sundaram earned 1500 total points
ID: 24366625
0
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 24366740
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")
0
 

Author Comment

by:lulu50
ID: 24367003
   

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"
0
 

Author Closing Comment

by:lulu50
ID: 31580617
Thanks,
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

647 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