Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am trying to use the Input function to read the contents of a text file into a variable. The text file is very large, and I keep getting the same message everytime I try to run code that I know works on other text files (they are smaller): "Input past end of file" Here is the code: ____________________________________________ FF = FreeFile ' get the next free file in line Open SourceFile For Input As FF ' Opens the text file stream lChars = LOF(FF) ' lChars is a LONG varaible AllText = Input(lChars, FF) ' Loads the textfile into the AllText variable (AllText is a string variable and i tried Variant too with the same result) Close FF _______________________________________________ The number of characters in the text file is 2,685,277. When the code is executed i get "Input past end of file". If I force the number of characters to a lower number, it all works fine. Any thoughts on what is going on, and if there is a workaround? Thanks, Seth |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Reading data from another sheet where data is in variable cells | Excel Discussion (Misc queries) | |||
sumproduct - reading a variable value | Excel Discussion (Misc queries) | |||
Reading Data from another workbook... depending on variable in a cell? | Excel Discussion (Misc queries) | |||
reading/inserting variable dates within a macro | Excel Programming | |||
Reading specific digits from a numeric variable | Excel Programming |