Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default XL2003 open .CSV problem

Hi All,

Earlier I used XL2000, and I had a macro opening a .CSV file:
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv"
worked correctly, it placed the semicolon-separated data into different
columns (I use a Hungarian version where list separator is semicolon).

Recently I had to upgrade to XL2003 (because I couldn't go without some
feature existing only in XL2003), and this statement doesn't work correctly
in XL2003: it opens the .csv file, but does NOT place the semicolon-separated
data into different columns.

I tried
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=4
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=6, delimiter:=";"
with the same result.

Can anybody help?

Regards,
Stefi

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default XL2003 open .CSV problem

Stefi,
Excel takes the delimiter from the Windows setting Regional
OptionsNumbersList Separator.
Set that to a semi colon or use the DataGet external dataImport Text file
menu.

NickHK

"Stefi" wrote in message
...
Hi All,

Earlier I used XL2000, and I had a macro opening a .CSV file:
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv"
worked correctly, it placed the semicolon-separated data into different
columns (I use a Hungarian version where list separator is semicolon).

Recently I had to upgrade to XL2003 (because I couldn't go without some
feature existing only in XL2003), and this statement doesn't work

correctly
in XL2003: it opens the .csv file, but does NOT place the

semicolon-separated
data into different columns.

I tried
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=4
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=6,

delimiter:=";"
with the same result.

Can anybody help?

Regards,
Stefi



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default XL2003 open .CSV problem

Hi Nick,
Thanks for your reply!
I checked my Windows setting Regional OptionsNumbersList Separator, it is
a semicolon.
I tried DataGet external dataImport Text file, it gave a worksheet-like
appearance (data in separate columns), but in a noname new workbook, not as
2005_12.csv workbook as in XL2000 which kept its .csv structure when saved,
and recorded as a macro it gave a very long list of statements instead of one
simple line.

The funny thing is that opening the .csv file manually gives the expected
correct sheet, and recording it as a macro generates this simple line:
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv"
but running this macro gives the incorrect result mentioned earlier.

Can you explain me why was it necessary to make worse what was good?

Regards,
Stefi


€˛NickHK€¯ ezt Ć*rta:

Stefi,
Excel takes the delimiter from the Windows setting Regional
OptionsNumbersList Separator.
Set that to a semi colon or use the DataGet external dataImport Text file
menu.

NickHK

"Stefi" wrote in message
...
Hi All,

Earlier I used XL2000, and I had a macro opening a .CSV file:
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv"
worked correctly, it placed the semicolon-separated data into different
columns (I use a Hungarian version where list separator is semicolon).

Recently I had to upgrade to XL2003 (because I couldn't go without some
feature existing only in XL2003), and this statement doesn't work

correctly
in XL2003: it opens the .csv file, but does NOT place the

semicolon-separated
data into different columns.

I tried
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=4
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=6,

delimiter:=";"
with the same result.

Can anybody help?

Regards,
Stefi




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default XL2003 open .CSV problem

How about:

Workbooks.OpenText Filename:="C:\Myfolder\2005_12.csv",
DataType:=xlDelimited, Semicolon:=True

(I just got this by recording a macro, opening the file, using the import
wizard with a semicolon and then cutting out the needless arguments)

"Stefi" wrote:

Hi All,

Earlier I used XL2000, and I had a macro opening a .CSV file:
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv"
worked correctly, it placed the semicolon-separated data into different
columns (I use a Hungarian version where list separator is semicolon).

Recently I had to upgrade to XL2003 (because I couldn't go without some
feature existing only in XL2003), and this statement doesn't work correctly
in XL2003: it opens the .csv file, but does NOT place the semicolon-separated
data into different columns.

I tried
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=4
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=6, delimiter:=";"
with the same result.

Can anybody help?

Regards,
Stefi

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default XL2003 open .CSV problem

Thanks Martin,
Your idea put me on the right track, but the Opentext method worked only
when I changed the file extension from .csv to .txt!

My questions still obtain: why is not XL2003 compatible with XL2000?

Regards,
Stefi


€˛Martin€¯ ezt Ć*rta:

How about:

Workbooks.OpenText Filename:="C:\Myfolder\2005_12.csv",
DataType:=xlDelimited, Semicolon:=True

(I just got this by recording a macro, opening the file, using the import
wizard with a semicolon and then cutting out the needless arguments)

"Stefi" wrote:

Hi All,

Earlier I used XL2000, and I had a macro opening a .CSV file:
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv"
worked correctly, it placed the semicolon-separated data into different
columns (I use a Hungarian version where list separator is semicolon).

Recently I had to upgrade to XL2003 (because I couldn't go without some
feature existing only in XL2003), and this statement doesn't work correctly
in XL2003: it opens the .csv file, but does NOT place the semicolon-separated
data into different columns.

I tried
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=4
Workbooks.Open Filename:="C:\Myfolder\2005_12.csv", Format:=6, delimiter:=";"
with the same result.

Can anybody help?

Regards,
Stefi



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XL2003 Destination and Source Open but not updating tim Excel Discussion (Misc queries) 2 December 14th 04 01:29 AM
still having problem with open currently open excel file John Coon Excel Programming 2 September 4th 04 04:34 PM
XL2003 Add Ins Melissa[_2_] Excel Programming 1 October 22nd 03 07:24 PM
xl2003 and VS Alex T Excel Programming 2 September 22nd 03 10:26 AM
xl2003 GUS Excel Programming 0 September 18th 03 08:16 PM


All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"