Excel 2000 Hanging while reading large file with Line Input

  • Thread starter Thread starter Guest
  • Start date Start date
Sorry something went wrong with my initial input. It should have been ...

I'm using a VB Code that reads large files to produce statistics. It Works with
Excel under NT 4 With an input file of 232 MB. With Excel 2000 under XP it remain
stuck on the first Line input instruction. However with the same input file truncate
to 10 MB it works perfectly. I suspect some setup problem (buffer size somewhere
the code is as follows

Open InvFile For Input As #1 ' Open Input fil

Do While Not Fin
Line Input #1, Inbu
...........

Any help would be highly appreciate
Regard
Jacques Brun
 
Open InvFile For Input As #1 ' Open Input file

Do While Not Eof(1)
Line Input #1, Inbuf
Loop

is the usual way to write this.
 
My input was unclear. To clarify
"Fini" is a boolean depending on EOF(1) and other conditions
When I use a breakpoint and step by step execution Excel hangs
when going to the "Line input #1, Inbuf" . The first execution
of this line of code is never ending. With the same input fil
truncated to 10 MB the program works as intended ... So
suspect that the cause is the size of the input file (232 MB)
and some Excel setup somewhere

Jacques Bru

----- Tom Ogilvy wrote: ----

Open InvFile For Input As #1 ' Open Input fil

Do While Not Eof(1
Line Input #1, Inbu
Loo

is the usual way to write this
 
If it chokes on the first visit to Line Input then I suspect your file isn't
really structured to use line input - if it isn't a text file with vbCRLf at
the end of each line and the lines of some reasonable length, then perhaps
that is the source of the problem. You might need to use one of the other
commands besides Line Input and read it in in pieces. If it does meet the
description above, then the size of the file should not be a restriction I
don't believe, because reading in one line at a time should be possible.
 
Back
Top