|
-
Nov 16th, 2001, 05:42 PM
#1
Thread Starter
Hyperactive Member
file in use error
I am using this loop several times in my app
Dim X As Short
For X = 1 To 5
Dim FSO As File
Dim FStreamObject As FileStream
FSO.Create(Application.StartupPath & "\" & X & ".txt")
FSO.SetAttributes(Application.StartupPath & "\" & X & ".txt", FileAttributes.Archive)
Next
It works fine the first time I go throught the loop. The problem is when it goes through the loop a second time, it generates the error "The process cannot access the file "C:\1.txt" because it is being used by another process.
Is there a way to release the handle on the file?
Also, I found how to write a byte array to a text file, but how do I write a string type?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|