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
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
Excel MVP
Christian
Jim Rech <jar...@kpmg.com> wrote in message
news:#f8AGweM$GA.231@cppssbbsa05...
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
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
>
......
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.
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...