Convert Excel (XLS) to CSV with UTF-8 using VBA
<p>I'm trying to convert excel to csv with UTF - 8 in a Macro. But while converting, the contents are changing to unwanted symbols and text.</p>

<p>Please help me in resolving this.</p>

<pre><code>Public Sub convert_UnicodeToUTF8()

   Dim parF1, parF2 As String

   parF1 = "D:\test.xlsx"

   parF2 = "D:\test.csv"

    Const adSaveCreateOverWrite = 2
    Const adTypeText = 2

    Dim streamSrc, streamDst ' Source / Destination
    Set streamSrc = CreateObject("ADODB.Stream")
    Set streamDst = CreateObject("ADODB.Stream")
    streamDst.Type = adTypeText
    streamDst.Charset = "utf-8"
    streamDst.Open

    With streamSrc
        .Type = adTypeText
        .Charset = "Unicode" ' this is also the default value
        .Open
        .LoadFromFile parF1
        .copyTo streamDst
        .Close
    End With
    streamDst.saveToFile parF2, adSaveCreateOverWrite
    streamDst.Close
    Set streamSrc = Nothing
    Set streamDst = Nothing

End Sub
</code></pre>

<p>Thanks.</p>