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