View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JP Ronse JP Ronse is offline
external usenet poster
 
Posts: 174
Default Workbooks.OpenText Method / FieldInfo

Hi,

What do you mean with "not possible to open a csv file"? Can't you open the
file, is the parsing not corect or is the retrieved data not correct?

AFAIK, it depends also on your locale settings, e.g. separator is set to ";"
and the file is using "," or vice versa or another character. How is the
file opened when you do it manually?

You say that renaming the file is not an option. I have had the same issue
and renaming the file was the work around.

You can create a copy of the .csv file to a .txt file with:

FileCopy strFile, "path" & Left(strFile, Len(strFile) - 4) & ".txt"

with strFile is the .csv file.

After reading/importing the .txt file, you can clean it up with:

Kill strFile (the .txt file of course).

Hope this helps.





"Volker Jordan" wrote in message
...
Hi,
after reading some posts about the OpenText method and the FieldInfo
parameter I want to ask a question.

Is it still not possible to open a csv file ( with .csv ending ) with all
columns declared as text?

Renaming the file to .txt is not an option.

Regards
Volker Jordan