View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Excel 2000 Hanging while reading large file with Line Input

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.

--
Regards,
Tom Ogilvy

"Jacques Brun" wrote in message
...
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 file
truncated to 10 MB the program works as intended ... So I
suspect that the cause is the size of the input file (232 MB)
and some Excel setup somewhere.

Jacques Brun

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

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.

--
Regards,
Tom Ogilvy



"Jacques Brun" wrote in message
...
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
remains
stuck on the first Line input instruction. However with the same

input
file truncated
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

file
Do While Not Fini

Line Input #1, Inbuf
............
Any help would be highly appreciated

Regards
Jacques Brun