Sub WriteToTextFile(FileUrl, mylist As Collection, CharSet)
Set Stm = CreateObject("adodb.stream")
Set b = CreateObject("ADODB.Recordset")
'MsgBox (Stm.EOS())
Stm.Type = 2
Stm.Mode = 3
Stm.CharSet = CharSet
Stm.Open
For Each myRow In mylist
'MsgBox (Stm.EOS)
Stm.WriteText myRow
Next
Stm.SaveToFile FileUrl, 2
Stm.flush
Stm.Close
Set Stm = Nothing
End Sub
Set Stm = CreateObject("adodb.stream")
Set b = CreateObject("ADODB.Recordset")
'MsgBox (Stm.EOS())
Stm.Type = 2
Stm.Mode = 3
Stm.CharSet = CharSet
Stm.Open
For Each myRow In mylist
'MsgBox (Stm.EOS)
Stm.WriteText myRow
Next
Stm.SaveToFile FileUrl, 2
Stm.flush
Stm.Close
Set Stm = Nothing
End Sub