View Single Post
Old 04-20-2009, 06:21 AM   #1 (permalink)
Roger Tinembart
 
Newb Techie

Join Date: Apr 2009

Posts: 3

Roger Tinembart is on a distinguished road

Default Excel VBA OpenText prevent from interpreting data

Hello
I have to open a textfile with the OpenText-Method. I recogniced that Excel tries to interpret the text data. For example, if there are HTML-Tags in the first 4 kB of the textfile, Excel interpretes them (and only them) and throws the remainig data away. Does anybody know how to prevent this? Unfortunatelly, i was not able to find a parameter to control this behaviour. I allready tried FieldInfo (i marked each column as xlTextFormat).

Simple test: save the following data as textfile as c:\temp\test.txt

Cell1 Cell2 Cell3
Cell1 Cell2 Cell3
<html><B>hello</html>
Cell1 Cell2 Cell3
Cell1 Cell2 Cell3

and open it with
Workbooks.OpenText Filename:="c:\temp\test.txt"

Thank you for any hints
Roger
Roger Tinembart is offline