Importing multiple text files to spreadsheet

  • Thread starter Thread starter lanwu
  • Start date Start date
L

lanwu

Hi Nikos or whomever,

Thaks for the code. I tried it out, & it managed to import the 1st fil
& then give the following error w/ 3 available buttons......

--------------------------------------------------------
Run-time error '1004'
Application-defined or object-defined error
--------------------------------------------------------

If i go into [Debug], I get the following line highlighted i
yellow....

-> ActiveCell.Offset(i, j).Value = vLine


As I'm not a VB programmer, I will try my best to figure this one ou
using the help & whatever else....but if anyone can shed some light o
how to overcome this quickly, that'd be much much appreciated......

I'm sure I'll learn some syntax here for VB, but this is prob. going t
be only a 1 time script for this programmer....
 
lanwu,

I can't tell why... any chance the second file has more than 256 lines, so
Excel "runs out" of columns? One way to tell is to run the code and when you
get the error go to debug, and while the line is highlighted, hover the
mouse over i, j, and vLine; when you leave the cursos over a variable for a
second or so, it will display its current value. If the problem is indeed
this, you should see j = 257. Also check for weird value in vLine.

If you can't straighten it out, you are welcome to zip the text files (or a
few of them, including the one you get the problem on, identify by hovering
mouse over f2.Name) and mail them to me, so I can have a look.

HTH,
Nikos

lanwu said:
Hi Nikos or whomever,

Thaks for the code. I tried it out, & it managed to import the 1st file
& then give the following error w/ 3 available buttons......

--------------------------------------------------------
Run-time error '1004'
Application-defined or object-defined error
[End] [Debug] [Help]
--------------------------------------------------------

If i go into [Debug], I get the following line highlighted in
yellow....

-> ActiveCell.Offset(i, j).Value = vLine


As I'm not a VB programmer, I will try my best to figure this one out
using the help & whatever else....but if anyone can shed some light on
how to overcome this quickly, that'd be much much appreciated......

I'm sure I'll learn some syntax here for VB, but this is prob. going to
be only a 1 time script for this programmer.....
 
Back
Top