Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing List separator in registry is not working

Status
Not open for further replies.

jaol

Programmer
Oct 16, 2003
13
DK
Hi all,
I would like to change the list separator in the registry HKEY_CURRENT_USER\Control Panel\International\sList form ";" to "|" using VBA from Excel.
this small code gives me the current separator:

Set WShell = CreateObject("WScript.Shell")
GetRegistry = WShell.RegRead("HKEY_CURRENT_USER\Control Panel\International\sList")

Then writing a new separator:
Set WShell = CreateObject("WScript.Shell")
WShell.RegWrite "HKEY_CURRENT_USER\Control Panel\International\sList", "|", "REG_SZ")

Looking in the Control Panel the separator has changed, but ....

saving my workbook as a csv-file
ActiveWorkbook.SaveAs filnavn, xlCSV, Local:=True
gives me a file with ";" as separator???

If I manually change the separator everythings works fine.

Why is my code not working?

Thanks in advance







 
I'd suggest that you use the proper way to change the locale's list separator. Check out the SetLocaleInfo API call
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top