Reading the separator from the regional settings in Excel 2002

G

Guest

I know there is a problem in excel 2002, that with saving as a CSV excel uses
always the US-Setting as regional settings (not using your choice for the
seperator). If I open a *.csv with excel 2002 it uses the regional settings
for the separator. So you have only one chance (microsoft workaround): Change
your separator to the US-style (","). In my VBA application I want to check
this with the following code:

list_sep = Application.International(xlListSeparator)

to ask for the separator. But with an english WindowsXP with an english
XL2002 I always receive an ";" also with an "," as separator in the regional
settings. Any ideas?
 
K

keepITcool

IF you're using xl2002 or newer, you could also use the LOCAL argument
in OpenText method.





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Thomas wrote :
 
G

Guest

Dear Tom, there is no field for the list seperator in the International Tab.
But this not my problem. I only want to know why I read a ";" with the
xllistseparator when I have changed it in the XP-regional settings from ";"
to ",". My regional options are "German (Germnay) and the default list
separator in German is ";". But I have changed it via customize to "," so
IMHO xllistseparator should deliver me a ",". You dont think so?
 
K

keepITcool

Thomas,

in regional settings you can customize settings and enter the same
character for decimal and list separator. MsWord may be able to work
with this.. but excel cannot.


if settings are "conflicting" excel will try to find a workable
solution, as it cannot handle a situation where decimal separator and
list separator are the same. (as it will not be able to parse a
formula string)

the decimal separator takes precedence, and excel will change the
listseparator to something else.
in my experience it will change the listseparator to a semicolon if the
decimal is a comma, and to a comma if the decimal is a dot)

to coding to check the regional settings is not relevant:
you need to check what excel made of things.
(MSWORD may be able to work with same setting for dec and list)

in Excel.. VBA
?application.international(xldecimalseparator)
,
?application.international(xllistseparator)
;


in MsWord (and ControlPanal/RegionalSettings
?application.International(wdDecimalSeparator )
,
?application.International(wdListSeparator )
,


HTH



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Thomas wrote :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top