View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Karpgam Karpgam is offline
external usenet poster
 
Posts: 1
Default Text file open and close VBA

Hi

I am new to VBA development, I have text file and opening
text file in my VBA to read. After that i want to Add new
line, so i Open it for output mode, (I will create delete
existing and create new file that is ok for me). Here is
my code

Open sXferFile For Output As #1
While Not EOF(1)
Line Input #1, stemp
sFileName = stemp
Line Input #1, stemp
' sProcessDate = CDate(STEMP)
sProcessDate = stemp
Wend
close #1
-- after this
sfnum = freefile
Open sXferFile For Output As #sFnum
write #sfnum, "Over"
close #sfnum


I am getting Path/file error when i open it after closing
text file.

Need help?

Thanks
kalyan