Reading Chinese characters from Excel worksheet? (Always returns "????")

How to read Chinese characters from Excel cells and write them to file? When I take values

Worksheets(ActiveCell.Worksheet.Name).Cells(3, columnNumbers(0)).value

      

it always returns "????????"

+3


source to share


2 answers


Dim fileStream, FilePath As String    

'Full properties file path
propFilePath = "C:\file.properties"

'Create Stream object
Set fileStream = CreateObject("ADODB.Stream")

'Specify stream type – we want To save text/string data.
fileStream.Type = 2

'Specify charset For the source text data.
fileStream.Charset = "utf-8"

'Open the stream And write binary data To the object
fileStream.Open
fileStream.writetext "write something here"

'Save binary data To disk
fileStream.SaveToFile FilePath, 2
fileStream.Close

      



+3


source


  • It could be a csv file
  • open with a text editor, save in UTF8 or UNICODE format


+1


source







All Articles