title: How to save worksheets as CSV files in UTF-8 format with Excel for Mac 2011?
body: <p>I have the following <strong>Excel VBA</strong> script which I use in <strong>Excel for Mac 2011</strong> to export all the worksheets of an Excel file to .csv files.</p>
  
  <pre><code>Sub save_all_csv()
      On Error Resume Next
      Dim ExcelFileName As String
      ExcelFileName = ThisWorkbook.Name
      For Each objWorksheet In ThisWorkbook.Worksheets
          ExcelFileNameWithoutExtension = RemoveExtension(ExcelFileName)
          CsvFileName = ExcelFileNameWithoutExtension &amp; "__" &amp; objWorksheet.Name &amp; ".csv"
          Application.DisplayAlerts = False
          objWorksheet.SaveAs Filename:="data:storage:original_excel:" &amp; CsvFileName, FileFormat:=xlCSV, CreateBackup:=False
          Application.DisplayAlerts = True
      Next
      Application.DisplayAlerts = False
      Application.Quit
  End Sub
  Function RemoveExtension(strFileName As String)
      strFileName = Replace(strFileName, ".xlsx", "")
      strFileName = Replace(strFileName, ".xls", "")
      RemoveExtension = strFileName
  End Function
  </code></pre>
  
  <p>The problem is that they save as <strong>Western Mac OS Roman</strong> which I can't get to convert to UTF-8 via PHP, so I would like to have VBA save these files in UTF-8 format in the first place.</p>
  
  <p><img src="https://i.stack.imgur.com/us0Fd.png" alt="alt text"></p>
  
  <p>I've found some solutions for saving text from VBA via a Stream object and with <a href="https://stackoverflow.com/questions/2524703/save-text-file-utf-8-encoded-with-vba">CreateObject</a> but it's <a href="https://stackoverflow.com/questions/4670420/how-can-i-install-use-scripting-filesystemobject-in-excel-2010-for-mac/4670622#4670622">apparently not possibile on the Mac to use CreateObject to write directly to files</a>.</p>
  
  <p><strong>How can I save worksheets as CSV files in UTF-8 format with Excel for Mac 2011?</strong></p>