Link to home
Start Free TrialLog in
Avatar of BAnders
BAndersFlag for Sweden

asked on

Listseparator

In general, a listbox with a valuelist use "," if decimal point i use and ";" if decimal comma is used. Since, I generate such list the regional settings will show which one is used.

A while ago, I updated to Windows 10 1903 and both decimalcomma is used and listseparator is used. After setting listseparator to ";" it works fine again.

Anyway, since the program is expected to work with both decimalpoint as well as decimalcomma the vba code must handle this and use the proper character. I know it is an api call to get the character, but is there a smart way to handle this?

Thanks in advance.

BAnders
Avatar of Norie
Norie

Not sure where you are working but in Excel VBA I can use this to get the list separator.
Application.International(xlListSeparator)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Joe Winograd
Joe Winograd
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BAnders

ASKER

Hi,
I am using MSAccess and that one has no application.International. Is it covered somewhere else? Afterall it is nearly a program development platform.

BAnders
In that case, use the registry entries, as I posted, and create your own ListSeparator variable.
Hi there! :)

In VBA, you can do this manually. Below is an example.

Workbooks.OpenText Filename:= TheFilePath, DataType:=xlDelimited, Semicolon:=True, Local:=True

Open in new window