PC Review


Reply
Thread Tools Rate Thread

Anyone speak Japanese excel?

 
 
shy1162
Guest
Posts: n/a
 
      5th Dec 2010
This imports binary code and converts to hex numbers. It has worked
flawlessly for years. Now in a excel 2003 Japanese language version,
not so flawlessly. It gets confused occasionally (5% error) and reads
two bits instead of one. Is there a way to turn off the Double-Byte
capability of Japanese language versions of excel? Can I add something
to the macro to force a single byte read?

02 0E 89 20 21 2F 02 01 Should look like
02 0E 8445 21 2F 02 01 I get this error
_________________________________________________________

Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(FileNameWithPath)
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
ColumnCount = 3
RowCount = Sheets("Sheet2").Range("N5").Value + 1 'Offset
RowCount = Val("&h" & RowCount & "&")
Do While ts.atendofstream = False 'Loop to fill column with HEX
numbers
DecimalByte = Asc(ts.Read(1))
HexByte = Hex(DecimalByte)
Cells(RowCount, ColumnCount) = HexByte
RowCount = RowCount + 1
Loop
ts.Close
 
Reply With Quote
 
 
 
 
Martin Brown
Guest
Posts: n/a
 
      8th Dec 2010
On 05/12/2010 07:26, shy1162 wrote:
> This imports binary code and converts to hex numbers. It has worked
> flawlessly for years. Now in a excel 2003 Japanese language version,
> not so flawlessly. It gets confused occasionally (5% error) and reads
> two bits instead of one. Is there a way to turn off the Double-Byte
> capability of Japanese language versions of excel?


That is a bad idea and will make you very unpopular with Japanese users.
DBCS is essential for the display of the Japanese language.

> Can I add something
> to the macro to force a single byte read?
>
> 02 0E 89 20 21 2F 02 01 Should look like
> 02 0E 8445 21 2F 02 01 I get this error
> _________________________________________________________
>
> Const ForReading = 1, ForWriting = 2, ForAppending = 3
> Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
> Dim fs, f, ts, s
> Set fs = CreateObject("Scripting.FileSystemObject")
> Set f = fs.GetFile(FileNameWithPath)
> Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)


I think this is your problem. In Japanese topbit set characters are
automatically interpretted as DBCS escapes. TristateUseFalse will force
ASCII single byte interpretation I think - though I haven't tried it.

The local default of Excel in Japan is obviously to support the local
language and interpret DBCS characters accordingly.

Regards,
Martin Brown

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
speak cells in Excel Dave Microsoft Excel Misc 3 26th Mar 2010 04:35 AM
How do I set my excel to speak what is typed in a cell? Blessed Microsoft Excel Misc 2 16th Sep 2009 10:46 PM
how to get excel to speak to me =?Utf-8?B?Z3ltIGJ1bm55?= Microsoft Excel Setup 2 4th Apr 2007 08:48 AM
How can I make Excel speak? =?Utf-8?B?bGpzY3BhMQ==?= Microsoft Excel Setup 1 10th Nov 2005 11:12 PM
Excel macro: Speak on enter Gary Peitzmeier Microsoft Excel Programming 3 1st Sep 2004 12:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:37 PM.