View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
mah_kum_70
 
Posts: n/a
Default Remove BOM from UTF-8 file


Hello,

I am creating a UTF-8 file using excel vba. It is putting the 3 byte
Byte Order Mark at the begining of the file automatically. Is there a
way to remove it?

I am using the following code to generate the file.


Sub MACRO5()
Dim DataSet As New ADODB.Stream
With DataSet
.Open
.Charset = "utf-8"
.WriteText "Line one "
.WriteText vbCrLf
.WriteText "Line two"


.SaveToFile "C:\temp\utftest.txt"
End With
DataSet.Close

Set DataSet = Nothing
end sub


--
mah_kum_70
------------------------------------------------------------------------
mah_kum_70's Profile: http://www.excelforum.com/member.php...fo&userid=2572
View this thread: http://www.excelforum.com/showthread...hreadid=537718