Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing regional settings

3 views
Skip to first unread message

Christian Thibaud

unread,
Nov 18, 1999, 3:00:00 AM11/18/99
to
Hi all,

I have been looking all the messages referencing to importing files . I am
using XL97 with Windows NT4.0
But I cannot find what i'm looking for. Suppose I have this information i
have picked up from Internet and saved as a text file..


item Max Min Prom Count
TOTAL 1,260 0,100 0,726 9.681

The commas should be points <e.g> 1,260 should be $1.260 and 9.681 should
be 9681.


I've tried [and did work 'manually'] to change the regional settings to
"Spanish [Argentina]" , then run a procedure to import that file, and wright
after that go back
to Regional settings and change again to English [United States].

I did use the macro recorder when trying to:
1) Switch to Spanish [Argentina] settings .
2) Run my procedure to make my query.
3) Switch again to English [ United States] settings.

The only thing that appeared recorded was the line on running the
procedure [step 2].
Am i missing something ?

I would very appreciated any help on modifying regional settings with a
procedure in VB.

Thanks in advance for your help.

Christian

Patrick Molloy

unread,
Nov 18, 1999, 3:00:00 AM11/18/99
to
I guess you could delete any . 's and then replace instances of ,
with .


Function ConvertComma(myString As String) As String
x = InStr(myString, ".")
Do While x > 0
myString = Left(myString, x - 1) & Mid(myString, x + 1)
x = InStr(myString, ".")
Loop
x = InStr(myString, ",")
Do While x > 0
myString = Left(myString, x - 1) & "." & Mid(myString, x + 1)
x = InStr(myString, ",")
Loop
ConvertComma = myString
End Function


tedious though it tests OK & as a function can be called from the
sheet or code

Jim Rech

unread,
Nov 18, 1999, 3:00:00 AM11/18/99
to
I would add to Patrick's reply that the Excel macro recorder does not record
actions taken outside of Excel. Furthermore, I have not found a way to
change regional settings via a macro in Excel AND have the current instance
of Excel recognize the change. Interestingly I have found that other
instances of Excel will recognize a change made by another Excel, but that's
no help here.

--
Jim Rech
Excel MVP


Christian Thibaud

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
Thanks anyway Jim ! !
I won't look any further on this, and will go back to change each cell
(thanks Patrick...)

Christian

Jim Rech <jar...@kpmg.com> wrote in message
news:#f8AGweM$GA.231@cppssbbsa05...

Tom Ogilvy

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
You can always read in the file yourself, parse the information and change
any character you wish.
The below URL should give you some hints on setting up the code to read in
the file.

http://support.microsoft.com/support/excel/content/fileio/fileio.asp
File Access with Visual Basic® for Applications


Regards,
Tom Ogilvy
MVP Excel

Christian Thibaud wrote in message <3835...@news.greennet.net>...

Christian Thibaud

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
Quickest answer in my life. Thanks Tom, I'll work on that.
BTW, i can't believe that using some API function, it would not be possible
to change those regional settings. But, I don't know anything about those
things, and I am afraid of making bigs mistakes that could damage the Office
System.
Any comment will be appreciate.

Christian

Tom Ogilvy <Thomas....@hqda.army.mil> wrote in message
news:eOhh#3pM$GA....@cppssbbsa02.microsoft.com...


> You can always read in the file yourself, parse the information and change
> any character you wish.
> The below URL should give you some hints on setting up the code to read in
> the file.
>
> http://support.microsoft.com/support/excel/content/fileio/fileio.asp
> File Access with Visual Basic® for Applications
>
>
> Regards,
> Tom Ogilvy
> MVP Excel
>

......

Jim Rech

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
>>BTW, i can't believe that using some API function, it would not be
possible
to change those regional settings. <<

I didn't say that, Christian. It's easy to change regional settings with
API calls. But I haven't found a way to make the *current* instance if
Excel *recognize* the change.

Christian Thibaud

unread,
Nov 19, 1999, 3:00:00 AM11/19/99
to
ok Jim,

As I see it, I'll try to learn about API functions before attempting to make
strange ?stupid? things.
Thanks for your time and comments.

Christian

Jim Rech <jar...@kpmg.com> wrote in message

news:eZhd2QqM$GA....@cppssbbsa02.microsoft.com...

0 new messages