VBA Excelmacros编写文件使用UTF-8编码

我在Excel中创build一个处理电子表格并将内容(文本)写入文件的macros。 我需要这个文件被编码为UTF-8。 我已经尝试使用OpenTextFile(… TristateTrue)和StrConv(.. vbUnicode)作为unicode打开文件,但只能将其转换为UTF-16。 我在网上到处search,找不到任何东西。 这甚至有可能吗?

谢谢

Dim fsT As Object Set fsT = CreateObject("ADODB.Stream") fsT.Type = 2 'Specify stream type - we want To save text/string data. fsT.Charset = "utf-8" 'Specify charset For the source text data. fsT.Open 'Open the stream And write binary data To the object fsT.WriteText "special characters: äöüß" fsT.SaveToFile sFileName, 2 'Save binary data To disk 

参考: 保存用VBA编码的文本文件UTF-8