Search code examples
vbastrconv

Special characters and StrConv


i have an xls with text in different languages, which include also german, greek, and so on.

I have to copy these texts to a html file.

The resulting text is not shown as expected, with special characters, like umlauts or greek characters.

For example: i have a cell with the word "öko"

Using something like:(to read)

test = Cells("36", "D").Value

and(to write):

fso.WriteLine ("<title>" & StrConv(test, vbUnicode) & "</title>")

what i see as title in the html file is ??k?o?.

Do i have to install or configure something in my system?

Thanks in advance


Solution

  • I think you missed a parameter in your OpenTextFile call. If the fourth parameter is -1, then it is Unicode.

    Have a look at https://msdn.microsoft.com/de-de/library/314cz14s(v=vs.84).aspx