Use Windows List Separator When Exporting CSV from Excel VBA
Question details
The user needs to export a CSV file using Excel VBA that respects the local Windows list separator instead of defaulting to a comma.

- Product
- Excel VBA
- Device & OS
- Windows
- Scenario
- Exporting or saving a workbook as a CSV file using a VBA macro.
- Observed behavior
- By default, the VBA SaveAs method saves CSV files using commas, ignoring the list separator configured in Windows regional settings.
Ensure you have access to the Developer tab and the VBA editor (ALT + F11) in your spreadsheet program, and check your Windows Regional Settings to confirm your preferred list separator character is correctly configured.
Use the Local Argument in the VBA SaveAs Method
Modify your existing VBA code to instruct Excel to respect the Windows regional settings by setting the Local argument to True.
When executing the SaveAs method in VBA, Excel defaults to US English settings for CSV files, which always uses a comma as the delimiter.
By adding the Local:=True parameter, you force Excel to use the list separator defined in the user's Windows Regional Settings (such as a semicolon in many European countries).
Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.
In the Project Explorer pane on the left, find and double-click the module containing your CSV export code.
Find the line of code containing the SaveAs method. Append the Local:=True parameter to the end of the argument list. Your code should look similar to this: ActiveWorkbook.SaveAs Filename:="Export.csv", FileFormat:=xlCSV, Local:=True
Press F5 or click the Run button to execute the macro. Verify that the output CSV file now uses your local Windows list separator.

Run Your VBA Macros Flawlessly in WPS Spreadsheets
WPS Office provides robust support for VBA macros. You can run your existing Excel scripts, including CSV exports with local separators, perfectly without modifying a single line of code.
- 1. Install WPS Office: Download and install WPS Office Free from the official website.
- 2. Open Your Workbook: Launch WPS Spreadsheets and open your macro-enabled workbook (.xlsm).
- 3. Run Your Macro: Navigate to the Developer tab, enable macros if prompted, and run your CSV export script exactly as you would in Excel.

Frequently Asked Questions
Why does Excel VBA default to commas for CSV files?
By default, VBA uses US-centric settings for CSV exports to maintain consistency across different regions and systems unless explicitly told to use local settings via the Local argument.
How do I change my Windows list separator?
Go to the Windows Control Panel, select 'Clock and Region', then 'Region'. Click 'Additional settings', and change the 'List separator' character to your preferred symbol (like a semicolon) before clicking Apply.
Does the Local:=True argument work for opening CSV files as well?
Yes, you can also use Local:=True in the Workbooks.Open method in VBA to ensure Excel correctly parses an incoming CSV file that relies on a local list separator instead of a comma.




