I've messed around with this sort of thing before, and would not
recommend it. Changing a users settings affects all applications, not
just Excel, so this could cause problems with other applications.
Moreover, if something happens and Excel crashes and fails to set the
values back to the user's defaults, Windows will be using the modified
settings, and your user will not be happy.
If you need to do this, you have to notify Excel with a message that the
settings have changed.
Public Declare Function PostMessage Lib "user32" _
Alias "PostMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Public Const WM_SETTINGCHANGE As Long = &H1A
Sub NotifyExcel()
PostMessage XLHWnd, WM_SETTINGCHANGE, 0&, ByVal 0&
End Sub
where XLHWnd is the HWnd to Excel.
I've had only limited success with this. For some reason, Excel doesn't
always seem to act on the message.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com ch...@cpearson.com
"Yves Ropbert" <in...@queformat.com> wrote in message
news:caef01c290e5$bc1e2d40$8af82ecf@TK2MSFTNGXA03...
> I am using GetLocaleInfo and SetLocaleInfo in VBA to read
> and set the decimal symbol (. or ,)in windows from Excel.
> It works fine but Excel will not update its sheets to
> reflect the change. However, it will update its sheets if
> I make the change through the control panel.
>
> Is there a way to tell Excel to update it sheets to
> reflect the changes in the regional settings of Windows
> (98 or 2000) using VBA? An email reply would be
> appreciated.
>