Downloading Unicode Text from txt file into excel collumn - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Downloading Unicode Text from txt file into excel collumn

ymnuhjymnuhj Posts: 1Member
'm trying to read Unicode from file correctly using VBA. However I managed read correctly only first string. Code:

Sub ReadTextFile()
Dim Buffer
Dim FSO As FileSystemObject
Dim FSOFile As TextStream
Dim FilePath As String
r = 1

FilePath = "C: ext.txt"

Set FSO = New FileSystemObject
If FSO.FileExists(FilePath) Then
Set FSOFile = FSO.OpenTextFile(FilePath, 1, False)
Buffer = vbNullString
Do While Not FSOFile.AtEndOfStream
Buffer = FSOFile.ReadLine()
ThisWorkbook.Worksheets(1).Cells(r, 1).Value = StrConv(Buffer, vbFromUnicode)
r = r + 1
MsgBox (FilePath & " does not exist")
End If
End Sub

I know it shouldn't be difficult but I'm trying second day without any progress. Does smb have any suggestions or solution?

Sign In or Register to comment.