View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
N.F[_2_] N.F[_2_] is offline
external usenet poster
 
Posts: 65
Default Why Im I getting an error in code..

Tried the quotations and still didnt work. Hey Rick I expanded on the code so
that u can look at why the For #1 statement does:
I think the #1 statmetnt is referred in the code in the line that states "
Line Input #1. See below


FName = "F:trial2.txt" For Input As #1
Open FName For Input Access Read As #1
.............
............
While Not EOF(1)
Line Input #1, WholeLine
If Right(WholeLine, 1) < sp Then
WholeLine = WholeLine & sp
End If








"Rick Rothstein (MVP - VB)" wrote:

Why Im I getting an error in the partial code below??
Im trying to import a tezt file, but when I try to run it it highlights
the
FName line and says the following messege: "Expected: line# or label or
statement or end of statement"

FName= F:\trial2.txt For Input As #1


I am not sure what the For Input As #1 part is supposed to be doing... you
are just trying to assign the path to the variable, right?

FName = "F:\trial2.txt"

Note the quote marks.

Rick