title: How to ensure dot as decimal separator when exporting excel to csv?
body: <p>I want to export some data via vba from excel to a csv-file and set the decimal separator to a <strong>dot</strong> (independent from local language or system settings).</p>
  
  <p>By now I already have the data in the excel file with a dot as decimal separator. It works on some systems very well, but on other ones (e.g. Swedish system settings), the decimal separator shows up as a comma after exporting to csv via excel vba.</p>
  
  <p>This is what my relevant code snippet looks at the moment:</p>
  
  <pre><code>' Set Export Parameters
  Application.DecimalSeparator = "."
  Application.ThousandsSeparator = ""
  Application.UseSystemSeparators = False
  ActiveSheet.Range("D4:G1048571").NumberFormat = "0.00"
  
  ' Open (new) output file
  Open fileSaveName For Output As #1
  
  ' Write date upfront
  Print #1, Trim(Worksheets("Output - Upload generator").Range("A2:A2"))
  
  ' Set data range for output
  Set myrng = Worksheets("Output - Upload generator").Range("A3:G" &amp; lastExportRow)
  
  ' Write data
  For i = 1 To myrng.Rows.count
      For j = 1 To myrng.Columns.count
          lineText = IIf(j = 1, "", lineText &amp; ";") &amp; myrng.Cells(i, j).Text
      Next j
      Print #1, lineText
  Next i
  
  ' Close output file
  Close #1
  </code></pre>
  
  <p>Until now, the export is successful with dot as decimal separator on some systems, but not on every system <strong>independent of local settings</strong> (e.g. swedish language settings - decimal separator appears as a comma). As I have tried already several things, like changing the separaor in excel advanced settings, but nothing worked for every system.</p>
  
  <p>I would be glad, if someone could give me a hint what to do to ensure the dot!</p>