Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to open UTF-8 files with Workbooks.OpenText
Hello,
We've written an Excel macro that opens a text files as a workbook. We use the Workbooks.OpenText method to accomplish this. It has been working fine, but we just recently noticed that if we open try to open a text file as a workbook that is in UTF-8 character set and includes some Extended Latin characters (which are two bytes in UTF-8) it splits these two-byte Extended Latin characters into two seperate characters as the macro creates the Excel workbook. We noticed that this problem is because Excel by default is treating the text file as an ANSI file although it is UTF-8, because a two-byte character in UTF-8 gets converted to two one-byte characters in ANSI. I tried to find out if the Workbooks.OpenText method has a parameter which forces Excel to open the text file as UTF-8 rather than defaulting to ANSI but couldn't find it. How can we force Excel to open a text file as a UTF-8 text file when opening text files as workbooks using Workbooks.OpenText? Thank you very much in advance, Mete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
GetOpen filename to open files(Workbooks) | Excel Discussion (Misc queries) | |||
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed | Excel Programming | |||
After OpenText all pastes from external apps use format from OpenText | Excel Programming | |||
Workbooks.OpenText | Excel Programming | |||
Using Workbooks.OpenText to read a tab-delimited file into a worksheet | Excel Programming |