Fail to open unicode txt file in excel
I'm not usre but I think the UNICODES look like Binary data. Opening a File
in Text Mode that contains Binary characters can have problems. When you
open a file in text Mode Basic expects carriage returns and line feed to be
in the file. Basic has a limitation for the length of a Text String. Errors
will occur in Basic if the Text String length is exceeeded.
try Opening the file in binary mode.
"SF" wrote:
Hi,
I can mannually import a unicode text file into excel by specifying the File
origin to be "65001 : Unicode (UTF-8)" but fail to automate the opening of
the same file with the following code.
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.OpenText "C:\PIC\OUTPUT.TXT" = Excel open the
OUTPUT.TXT file but not display the correct Unicode format
Could someone advice
SF
|