View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Importing text files automaticly.


Array(Array(1, 1), Array(2, 2))
The first of the two characters for each field specifies the column (or character number)
and the second character specifies the data format...
1 is general and 2 is text.
So in the above example the first column has a general format
and the second column has a text format.
And the details are found in the "OpenText Method" in the Excel VBA help file.

Also, this link has helpful advice on posting to Excel newsgroups...
http://www.cpearson.com/excel/newposte.htm
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)


"Uradox"
wrote in message
Hi
I wrote a parser for my company that creates excel friendly text files that
saves a lot of time importing them manually. The text file is formatted in
such a way excel can read the correct column sizes and all data is imported
perfectly.
Normally if you open this text file in excel the import text wizard pops up.
Now to the problem
I wish my parser tool to automatically open the txt file in excel as it does
via parameters. However I need to change the column data format (last option
in the text wizard). By default excel imports everything as General. The last
column needs to be text else the data isnt imported correctly.
Is there a parameter that can also specify column formats? I dont mind even
if there is a parameter to make the wizard show also.
Thanks
Kevin