PDA

View Full Version : Save text file as unicode from Excel VBA



norm42
07-24-2013, 10:49 AM
After opening a text file with the following code:

Sub TestTXTFileOpen()


Dim fileToOpen As String


fileToOpen = Application.GetOpenFilename("Text Files (*.txt), *.txt")
Shell ("C:\Windows\notepad.exe " & fileToOpen)


End Sub

I want to be able to save fileToOpen as unicode. I'm stumped on this so far.

Kenneth Hobs
07-24-2013, 11:05 AM
Welcome to the forum!

Use StrConv() to convert strings to and from Unicode.

norm42
07-24-2013, 11:26 AM
I may need to add some additional info. I'm wanting to perform a text file Save As and change the Encoding box from ANSI to Unicode. I'm not clear on how I could do that with StrConv().