Dear Members,
I have finished several projects to calculate certain prices, however I'm running into problems with other computers who use european standard settings.
My calculations are based on the "." system as a decimal point.
However, almost all computers are using a comma. This messes up my calculations that are being written to Excel and get a bunch of wrong numbers.
The code I found somewhere on the internet is this:
I realize this is an Excel code, can anyone help me translate this into VB6 code?
I keep getting "Only text can come after end function end sub etc etc." on the 3rd paragraph code.
Thanks as always,
Jerome
I have finished several projects to calculate certain prices, however I'm running into problems with other computers who use european standard settings.
My calculations are based on the "." system as a decimal point.
However, almost all computers are using a comma. This messes up my calculations that are being written to Excel and get a bunch of wrong numbers.
The code I found somewhere on the internet is this:
Code:
'Written: December 29, 2010
'Author: Leith Ross
'Summary: Changes the decimal separator from a period to comma. Another macro
' reverses the operation to restore the period as the decimal separator.
Private dwLCID As Long
Private Const LOCALE_SDECIMAL = &HE
Private Declare Function SetLocaleInfo _
Lib "kernel32.dll" _
Alias "SetLocaleInfoA" _
(ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String) As Boolean
Private Declare Function GetSystemDefaultLCID _
Lib "kernel32.dll" () As Long
Sub ChangeDecimalSeparator()
Dim RetVal As Long
dwLCID = GetSystemDefaultLCID
RetVal = SetLocaleInfo(dwLCID, LOCALE_SDECIMAL, ".")
If RetVal = 0 Then
MsgBox "Unable to Change the Decimal Separator.", vbOKOnly + vbCritical
Exit Sub
End If
End Sub
I realize this is an Excel code, can anyone help me translate this into VB6 code?
I keep getting "Only text can come after end function end sub etc etc." on the 3rd paragraph code.
Thanks as always,
Jerome