Application.ConvertLocale
This function converts a spreadsheet formula or selection condition expression between US locale and local regional setting.
Syntax | Parameters | Return Value |
---|---|---|
Function Application.ConvertLocale( _ formula As String, _ opt As ConvertLocaleOpt) As String |
The formula to convert. Type: String How to format the formula. Type: ConvertLocaleOpt |
String |
SVB Example
Formatting a formula to work under different locales:
Option Explicit Option Base 1 Sub Main 'If your regional settings are set to something like German, then assigning "=Min(v1, 25.7)" 'as a formula to a spreadsheet will fail. Calling ConvertLocale will properly format 'the formula so that the parser will understand it. For example, it may reformat "=Min(v1, 25.7)" 'into "=Min(v1; 25,7)". ActiveDataSet.VariableLongName(2) = Application.ConvertLocale("=Min(v1, 25.7)", scToInternational) ActiveDataSet.Recalculate End Sub
Copyright © 2020. Cloud Software Group, Inc. All Rights Reserved.