Macro to Print Text to file in UTF-8

  • Thread starter jakeatkins via OfficeKB.com
  • Start date
J

jakeatkins via OfficeKB.com

Hello,

I am trying to print the value of a cell in Excel to a file "temp.html". The
button's macro looks like this:

Sub Text()
Dim i As Long
Open "c:\temp\Homepage.html" For Output As #1
For i = 1 To Selection.Cells.Count
Print #1, Selection.Cells(i).Value
Next i
Close 1
End Sub

I need to know what to add to this code so that the file is created as UTF-8
encoding. I am trying to preserve foreign characters, and currently they are
all being saved as "???????????".

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top