Excel 2003 - VBA - Text File Import

  • Thread starter Thread starter C Brandt
  • Start date Start date
C

C Brandt

One of my routines Imports data from an external text file. To create the
code, I simply recorded the proceedure and incorporated the code in my
routine. While this is handy, and in most cases absolutely necessary, it can
lead to alot of code theat is not understood. Such is the case of
..TextFilePlatform as part of the Query code. My code is ".TextFilePlatform =
437" and the system fails with "an invalid procedure call or argument" when
it reaches this line.
If I force my way past this line it fails a little further down, still
within the Query code, at the ".TextFileTrailingMinusNumbers = True" Line.
Forced past this, and the query completes and the data appears to be good.

Any suggestions?

Craig
 
I recorded a text query and got code undoubtedly similar to yours. Only
when I ran it there were no problems. The only reason I can think of for
those lines to fail is if you were running the code on a version of Excel
that does not support them, maybe Excel 2000.

But regardless of version, you can probably delete the both lines. The
first is window dressing and the second is the default, but if you do not
have "numbers with trailing minus signs" you don't need it.

As to what each line does, select each property you want to learn about and
press F1.

--
Jim
| One of my routines Imports data from an external text file. To create the
| code, I simply recorded the proceedure and incorporated the code in my
| routine. While this is handy, and in most cases absolutely necessary, it
can
| lead to alot of code theat is not understood. Such is the case of
| .TextFilePlatform as part of the Query code. My code is ".TextFilePlatform
=
| 437" and the system fails with "an invalid procedure call or argument"
when
| it reaches this line.
| If I force my way past this line it fails a little further down, still
| within the Query code, at the ".TextFileTrailingMinusNumbers = True" Line.
| Forced past this, and the query completes and the data appears to be good.
|
| Any suggestions?
|
| Craig
|
|
 
Back
Top