How to enable save as csv utf-8 encoding in Excel 2016? Web options not working...

Anonymous
2023-06-20T17:39:14+00:00

Hello,

I followed the steps from this post, How to enable save as csv utf-8 encoding in Excel 2016? - Microsoft Community to try to enable UTF-8 in Excel 2016. However, my file is still not saving in UTF-8 format.

Thank you!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

10 answers

Sort by: Most helpful
  1. Andreas Killer 144K Reputation points Volunteer Moderator
    2023-06-22T07:11:51+00:00

    Also this code did not work correctly!

    It converts the data to CSV UTF-8 BOM, but the number of fields are wrong and the currency signs are missing because they are inside the cell format!

    Output:

    Name,Price
    Killer, Andreas,123.45
    Andreas Killer,234.56

    Andreas.

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2023-06-22T08:34:58+00:00

    To whom it may concern....

    Table (list object) in active sheet

    pic1

    Image

    result

    (regional settings, semicolon delimiter)

    csv file (save in this workbook path)

    open through notepad

    pic2

    Image

    pic3

    open csv file

    ========================

    vba code

    [Update-1]

    Sub SaveAs_CSV_UTF8_Format()

    '## AnastasiosGr // 22-June-2023 ##

    Dim wb1 As Workbook, wb2 As Workbook

    Set wb1 = ThisWorkbook

    Dim ws As Worksheet

    Set ws = wb1.ActiveSheet

    Dim lo

    Set lo = ws.ListObjects(1)

    Dim sPath, file1Path, file2Path

    Application.ScreenUpdating = False

    Application.DisplayAlerts = False

    sPath = wb1.Path & ""

    file1Path = sPath & "tmp.csv"

    file2Path = sPath & ws.Name & "-utf8.csv"

    Set wb2 = Workbooks.Add(1)

    lo.Range.Copy Range("A1")

    wb2.SaveAs file1Path, FileFormat:=xlCSV, local:=True

    wb2.Close False

    Dim obj As Object

    Dim x

    Dim sData

    x = FreeFile

    Open file1Path For Input As #x

    sData = Input$(LOF(x), x)

    sData = sData & vbCrLf

    Close x

    Set obj = CreateObject("ADODB.Stream")

    obj.Charset = "utf-8"

    obj.Open

    obj.WriteText sData

    obj.SaveToFile file2Path, 2

    obj.Close

    Kill file1Path

    Set obj = Nothing

    Application.DisplayAlerts = True

    Application.ScreenUpdating = True

    Dim npad

    npad = Shell("C:\WINDOWS\notepad.exe " & file2Path, 1)

    End Sub

    ======================

    note1

    a part of code from this link https://officetricks.com/vba-to-change-file-encoding-ansi-to-utf8-text-to-unicode/

    0 comments No comments
  4. Andreas Killer 144K Reputation points Volunteer Moderator
    2023-06-22T10:22:09+00:00

    I followed the steps from this post, How to enable save as csv utf-8 encoding in Excel 2016? - Microsoft Community to try to enable UTF-8 in Excel 2016. However, my file is still not saving in UTF-8 format.

    Hi Claudette.

    Here is my promised answer. Since it was a bit longer, I immediately created a community article about it.

    Save a sheet as CSV UTF-8 in Excel 2016 and before - Microsoft Community

    Please give me a sign if that is helpful for you, so I can be sure I don't missed a part before I edit the the other post you mentioned.

    Andreas.

    0 comments No comments
  5. Andreas Killer 144K Reputation points Volunteer Moderator
    2023-06-22T10:28:27+00:00

    try this approach...

    Did not work either... please spare me.

    0 comments No comments