Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Temporarily modify international options

Hi,

Is there anybody that could help me with this issue ?

I am in Montreal (Quebec) and I always use the period (.) as decimal symbol
and the comma (,) as thousands delimiter.

I have to develop Excel applications for any kind of environment, and I
often have to make them change their regional settings to let the program
run correctly. Some are like me, american style but others use the french
options (comma for decimals and space for thousands).

How can I access (in VBA) the user's regional settings, read them, change
them for the time the program is running and return them to their original
state when the application ends ?

My environment (and client's) :
Windows XP and Office 2003

Thank you very much.

Pierre




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Temporarily modify international options

To query the regional settings, look up XlApplicationInternational in the
Object Browser. For example:
MsgBox Application.International(xlDecimalSeparator)

I can't say for sure and haven't ever done it, but IMO to programmatically
change regional settings would likley require writing to the registry. For a
list of API candidates see http://www.allapi.net/apilist/r.shtml.
Suggest you look at:
RegOpenKey
RegCloseKey
RegSetValueEx
RegCreateKey
RegQuerryValue

The path to the regional settings appears to be:
HKEY_CURRENT_USER Control Panel International

* AS YOU ARE AWARE MESSING WITH THE REGISTRY CAN BE VERY RISKY! *

Do you really need to change the settings instead of structuring your code
to handle it? Perhaps setting variables to return values instead of hard
coding them:

s = Application.International(xlListSeparator)

Regards,
Greg


"Pierre Archambault" wrote:

Hi,

Is there anybody that could help me with this issue ?

I am in Montreal (Quebec) and I always use the period (.) as decimal symbol
and the comma (,) as thousands delimiter.

I have to develop Excel applications for any kind of environment, and I
often have to make them change their regional settings to let the program
run correctly. Some are like me, american style but others use the french
options (comma for decimals and space for thousands).

How can I access (in VBA) the user's regional settings, read them, change
them for the time the program is running and return them to their original
state when the application ends ?

My environment (and client's) :
Windows XP and Office 2003

Thank you very much.

Pierre





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Temporarily modify international options

Pierre,
Check the recent posts in this NG from "Alex St-Pierre". He's involved in
something similar.

NickHK

"Pierre Archambault" wrote in message
...
Hi,

Is there anybody that could help me with this issue ?

I am in Montreal (Quebec) and I always use the period (.) as decimal

symbol
and the comma (,) as thousands delimiter.

I have to develop Excel applications for any kind of environment, and I
often have to make them change their regional settings to let the program
run correctly. Some are like me, american style but others use the french
options (comma for decimals and space for thousands).

How can I access (in VBA) the user's regional settings, read them, change
them for the time the program is running and return them to their original
state when the application ends ?

My environment (and client's) :
Windows XP and Office 2003

Thank you very much.

Pierre






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Temporarily modify international options

Sounds like everyone wants to help you to do this - however, I can't think
of a single application I have ever used that changes my regional settings
and if I ran across one, I doubt I would run it more than once. Excel vba
is pretty much designed to work in an international environment. Stephen
Bullen's offers some hints and tips he

http://www.oaltd.co.uk/ExcelProgRef/ch22/

--
Regards,
Tom Ogilvy


"Pierre Archambault" wrote in message
...
Hi,

Is there anybody that could help me with this issue ?

I am in Montreal (Quebec) and I always use the period (.) as decimal
symbol and the comma (,) as thousands delimiter.

I have to develop Excel applications for any kind of environment, and I
often have to make them change their regional settings to let the program
run correctly. Some are like me, american style but others use the french
options (comma for decimals and space for thousands).

How can I access (in VBA) the user's regional settings, read them, change
them for the time the program is running and return them to their original
state when the application ends ?

My environment (and client's) :
Windows XP and Office 2003

Thank you very much.

Pierre






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
Modify language options from control panel using VBA Alex St-Pierre Excel Programming 2 January 21st 07 02:50 PM
other options to functions which cannot modify contents? James Cornthwaite Excel Programming 1 June 5th 06 12:46 AM
How do I Modify The XML View Options eroc New Users to Excel 0 May 2nd 06 04:11 AM
Using VBA to temporarily bypass regional options Carim[_3_] Excel Programming 5 March 9th 06 02:34 PM
Cannot modify Excel Tools Options a dialup dinosaur Excel Discussion (Misc queries) 0 January 9th 06 10:07 PM


All times are GMT +1. The time now is 09:53 AM.

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"