Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Comma-delimited files and Reional Settings

I am using Excel to download and process data from Yahoo, f.ex.

The code I use is
.....
Workbooks.Open Filename:=s1 + Range("D4") + pcode
+CStr(Range("Settings!G25")) + s3
Cells.Copy
Windows(MyWindow).Activate
Sheets("HistoryData").Cells.Select
Sheets("HistoryData").Paste
.....

Filename resolves to f.ex.
http://ichart.yahoo.com/table.csv?s=...86&ignore=.csv

This works fine for me, but on computers with Regional Settings that
specify "," as decimal symbol there is a problem. All data are put in
a single column.

Is there any way to temporarily change the decimal symbol setting?

Thx.
Lester
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Comma-delimited files and Reional Settings

No, but if you rename the file to have a .txt extension and then use
opentext rather than open, you would have more control on how the file is
parsed. I assume the layout will be constant.

In excel 2002 and later, there are some settings associated with opening a
text file that might help. I don't have a copy handy, so I can't give you
specifics. I believe in the Workbooks.Open method, they have added a Locale
setting that might help. There were also some additions in the import text
area under the data =Get External Data menu as I recall.

Dave Peterson had posted a comment relating to using the Text Import wizard:

xl2002 has an button (advanced...) on step 3 of the wizard that allows you
to
specify the decimal point character, the thousands character and how to
treat
trailing minuses.

so there is probably a setting for this as well in OpenText which is the vba
equivalent to the text import wizard - at least in terms of specifying the
settings.

--
Regards,
Tom Ogilvy


<Lester wrote in message ...
I am using Excel to download and process data from Yahoo, f.ex.

The code I use is
.....
Workbooks.Open Filename:=s1 + Range("D4") + pcode
+CStr(Range("Settings!G25")) + s3
Cells.Copy
Windows(MyWindow).Activate
Sheets("HistoryData").Cells.Select
Sheets("HistoryData").Paste
.....

Filename resolves to f.ex.

http://ichart.yahoo.com/table.csv?s=...86&ignore=.csv

This works fine for me, but on computers with Regional Settings that
specify "," as decimal symbol there is a problem. All data are put in
a single column.

Is there any way to temporarily change the decimal symbol setting?

Thx.
Lester



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Comma-delimited files and Reional Settings

Thank you, that could be a way forward, albeit somewhat slow. Trouble
is the data look as follows:

2-Jun-04,26.12,26.28,26.01,26.13,54020000,26.13
1-Jun-04,26.13,26.27,25.87,26.11,48369500,26.11
28-May-04,26.14,26.35,26.02,26.23,37393000,26.23
etc...

So the first dataset is a date in a format that will not translate
into other languages.

If the regional settings cannot be changed, can they be read so that I
can alert users of the problem?

On Sat, 12 Jun 2004 09:35:59 -0400, "Tom Ogilvy"
wrote:

No, but if you rename the file to have a .txt extension and then use
opentext rather than open, you would have more control on how the file is
parsed. I assume the layout will be constant.

In excel 2002 and later, there are some settings associated with opening a
text file that might help. I don't have a copy handy, so I can't give you
specifics. I believe in the Workbooks.Open method, they have added a Locale
setting that might help. There were also some additions in the import text
area under the data =Get External Data menu as I recall.

Dave Peterson had posted a comment relating to using the Text Import wizard:

xl2002 has an button (advanced...) on step 3 of the wizard that allows you
to
specify the decimal point character, the thousands character and how to
treat
trailing minuses.

so there is probably a setting for this as well in OpenText which is the vba
equivalent to the text import wizard - at least in terms of specifying the
settings.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Comma-delimited files and Reional Settings

look in Excel VBA help at Application.International

--
Regards,
Tom Ogilvy

<Lester wrote in message ...
Thank you, that could be a way forward, albeit somewhat slow. Trouble
is the data look as follows:

2-Jun-04,26.12,26.28,26.01,26.13,54020000,26.13
1-Jun-04,26.13,26.27,25.87,26.11,48369500,26.11
28-May-04,26.14,26.35,26.02,26.23,37393000,26.23
etc...

So the first dataset is a date in a format that will not translate
into other languages.

If the regional settings cannot be changed, can they be read so that I
can alert users of the problem?

On Sat, 12 Jun 2004 09:35:59 -0400, "Tom Ogilvy"
wrote:

No, but if you rename the file to have a .txt extension and then use
opentext rather than open, you would have more control on how the file is
parsed. I assume the layout will be constant.

In excel 2002 and later, there are some settings associated with opening

a
text file that might help. I don't have a copy handy, so I can't give

you
specifics. I believe in the Workbooks.Open method, they have added a

Locale
setting that might help. There were also some additions in the import

text
area under the data =Get External Data menu as I recall.

Dave Peterson had posted a comment relating to using the Text Import

wizard:

xl2002 has an button (advanced...) on step 3 of the wizard that allows

you
to
specify the decimal point character, the thousands character and how to
treat
trailing minuses.

so there is probably a setting for this as well in OpenText which is the

vba
equivalent to the text import wizard - at least in terms of specifying

the
settings.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Comma-delimited files and Reional Settings

You also might want to look at Chip Pearson's site:

http://www.cpearson.com/excel/imptext.htm

--
Regards,
Tom Ogilvy

<Lester wrote in message ...
Thank you, that could be a way forward, albeit somewhat slow. Trouble
is the data look as follows:

2-Jun-04,26.12,26.28,26.01,26.13,54020000,26.13
1-Jun-04,26.13,26.27,25.87,26.11,48369500,26.11
28-May-04,26.14,26.35,26.02,26.23,37393000,26.23
etc...

So the first dataset is a date in a format that will not translate
into other languages.

If the regional settings cannot be changed, can they be read so that I
can alert users of the problem?

On Sat, 12 Jun 2004 09:35:59 -0400, "Tom Ogilvy"
wrote:

No, but if you rename the file to have a .txt extension and then use
opentext rather than open, you would have more control on how the file is
parsed. I assume the layout will be constant.

In excel 2002 and later, there are some settings associated with opening

a
text file that might help. I don't have a copy handy, so I can't give

you
specifics. I believe in the Workbooks.Open method, they have added a

Locale
setting that might help. There were also some additions in the import

text
area under the data =Get External Data menu as I recall.

Dave Peterson had posted a comment relating to using the Text Import

wizard:

xl2002 has an button (advanced...) on step 3 of the wizard that allows

you
to
specify the decimal point character, the thousands character and how to
treat
trailing minuses.

so there is probably a setting for this as well in OpenText which is the

vba
equivalent to the text import wizard - at least in terms of specifying

the
settings.






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
Saving as tab delimited or comma delimited MathGrace Excel Discussion (Misc queries) 0 June 20th 08 08:02 PM
Tab delimited to comma delimited Arne Hegefors Excel Worksheet Functions 3 December 13th 07 03:08 PM
Comma Delimited-need comma at beginnng & end Tattoo Excel Discussion (Misc queries) 2 December 11th 07 04:39 PM
Comma Delimited Numbers Spannerman Excel Discussion (Misc queries) 3 April 3rd 07 08:19 AM
How do I turn off autoformat for .CSV (comma delimited) files? Mike Schwartz Excel Discussion (Misc queries) 1 February 2nd 06 09:08 PM


All times are GMT +1. The time now is 07:33 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"