file not found error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey everyone,

I just got laden with this as a new project, and I would greatly appreciate
any help on this. I need to extract some data from a temporary file on a
regular basis, which I do with the following snippet of code

Open "C:\Documents and Settings\Chris\My Documents\BIDMC\temp.txt"
For Input As #1
names = Input(FileLen("C:\Documents and Settings\Chris\My
Documents\BIDMC\temp.txt"), #1)
nameStart = InStr(names, "u_id") + 17
names = Mid(names, nameStart, InStr(nameStart, names, " ") -
nameStart)
Close #1
![firstname] = Mid(names, 1, InStr(names, ",") - 1)
![lastname] = Mid(names, InStr(names, ",") + 1)
.Update
.MoveNext
Shell "del C:\Docume~1\Chris\MyDocu~1\BIDMC\temp.txt", vbHide

The problem comes in at the last line, where is tells me that the "file
could not be found". Since the rest of the code works right, I'm pretty sure
the path is correct, and the file even deletes when I call the last line at
the shell prompt. Any ideas on what is wrong here are greatly appreciated.

Thanks in advance

Chris
 
Hi,
but you use short folder names in last line - perhaps it is not the same as
in first line?
you can also try to use Kill statement together with long folder names
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top