Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open and Save Unicode Text file in Microsoft Excel

Status
Not open for further replies.

yeungsprite

Programmer
Nov 28, 2002
25
US
Hi,

I am a new VB coder trying to import a unicode text file into Microsoft Excel to perform a spell checking function, and then to have it save as a new text file. I am having problems with the saving of the text file, because it is creating a file full of unrecognizable words. I have some very simple code to open and save a text file in Excel and would like to know where the problem is. I think it may be related to the function called to save the file?:

Dim ExcelApp As Excel.Application
Dim xlBook As Excel.Workbooks
Dim pathname As String

Set xlBook = Excel.Workbooks
Set ExcelApp = New Excel.Application

xlBook.Open "C:\textfile.txt"

xlBook.Application.SaveWorkspace "C:\valid.txt"

ExcelApp.Quit
Set ExcelApp = Nothing

Thanks in advance!
 
ActiveWorkbook.SaveAs FileName:=filename, FileFormat _
:=xlUnicodeText, CreateBackup:=False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top