CSV

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello everyon

we have a problem with the import from csv-files with semicolon with
vba-macro. in the past with the old system (windows nt 4.0 german wit
office 97 sp2) it worked without problems

our system
- windows xp sp1 english with mui (german/french
- office xp sp2 english with mui sp2 (german/french

if we try to open a csv-file in the windows explorer, it works because i
the regional settings we have set the separator to ";"

if we try to open the csv-file with a vba-macro it copies the data in th
first column. then i searched informations in the internet and the onl
solution seems to be to change the macro code

if we rename the csv-file in a txt-file, then it works with the SAME macr
code

here our vba codes. i've tried two ways


Dim sFile As Strin
sFile = "P:\test.csv
Workbooks.OpenText sFile, DataType:=xlDelimited, semicolon:=Tru


an

Workbooks.OpenText "P:\test.csv",
DataType:=xlDelimited, Semicolon:=False,
tab:=False, comma:=True,
Space:=False, other:=False, otherchar:=Fals

both ways give the same bad result. only if we rename the csv in a txt-fil
then it works

and the other way: we create the csv-files with comma-separator but that i
to time-expensiv. and we don't want to change the csv-files because of th
old system. and if possible we don't want to change all 100 excel-files..
so the best solution would be a change by windows xp or office xp with
registry cheat or similar...

Have anyone an idea how we can make that

thanks for your respone

Best regard

Robert Laud
 
Robert

Until someone gives you a proper solution if the file is
opened, try recording Data, TextToColumns., This should
give you the coreect separators.

Regards
Peter
 
Back
Top