Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateTextFile with FSO 1

Status
Not open for further replies.

devRyan

Programmer
Sep 1, 2006
104
US
Hi All,

Was hoping I could get some quick help. I'm trying to use the FSO to create a file, but can't seem to get it to work.
Could someone please tell me what I'm doing wrong?

I've got the Windows Scripting Library is referenced, so it recognizes my objects. Mainly though, I don't know what type to dim my actual file as.

Thank you.

Ryan

Code:
Dim fso As Scripting.FileSystemObject
Dim csvFile As File '<- Is this right?
Set csvFile = fso.CreateTextFile(strFile, False, False)
 




Did you check the methods for the File Object?

Skip,
[sub]
[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue][/sub]
 
No, because I'm already pretty sure it's wrong. So what type should it be dimmed as?
 
I've used the FSO extensively with asp and vbs, but not with vba, so have never had to worry about the files type.
 



If you have used FSO extensively, then you ought to know about objects and their properties and methods.

You need to check out the METHODS available to the File Object.

Skip,
[sub]
[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top