LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2003 VBA program kills itself in Japan


I confirm.
Code changes itself between English and Japanese computers.
You will not find that bug if you simply change language to Japanese.
You have to have "true" Japanese Windows.


It happens when "text code" is internally loaded and interpreted by VBE
and it happens for non-ascii characters.

just new feature.

workaround for this is to build that string dynamically not to use
non-ascii characters in code

instead of
ill = "´`@‚¬Â²Â³Â°^<\*./[]:;|=?,"""

it should be
ill = chrw(1234) + chrw(2345)+ chrw(3456) .... and so on.







On 2/23/2010 9:30 AM, Christian Treffler wrote:
Hi,

I wrote a VBA program for an Excel workbook. This program works just
fine on my PC (US English setup), but my japanese collegues have
problems. We observed that the VBA program changes on a japanese PC to
the extent that syntax errors occur.

This is how it happens:

My code looks like this:
------------------------------------
Function ReplIllegal(ByVal txt As String) As String
Dim ill As String

ill = "´`@‚¬Â²Â³Â°^<\*./[]:;|=?,""" ' list of illegal characters
ReplIllegal = ""

txt = Replace(txt, "ä", "ae")
txt = Replace(txt, "ö", "oe")
txt = Replace(txt, "ü", "ue")
txt = Replace(txt, "Ä", "Ae")
<snip
-------------------------------------

If the workbook is opened on a japanese computer, the code looks like
this
('$' stands for various japanese characters):
------------------------------------
Function ReplIllegal(ByVal txt As String) As String
Dim ill As String

ill = "$`@$$$$^<$*./[]:;|=?,""" ' Japanese characters!
ReplIllegal = ""

txt = Replace(txt, ". , "ae") ' Syntax Error
txt = Replace(txt, ". , "oe") ' Syntax Error
txt = Replace(txt, ". , "ue") ' Syntax Error
txt = Replace(txt, "$", "Ae")
<snip
-------------------------------------

Very bad is the replacement of "ä" by ". where the closing quotation
mark gets lost. That leads to a syntax error.

Is there any chance to avoid this problem? The solution must be applied
to the workbook. A client side solution (e.g. installation of an add-on)
is not acceptable.

TIA,
Christian


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help please - I want to program an interface to Excel 2003 Big UT Fan Excel Discussion (Misc queries) 3 March 7th 10 06:05 AM
SP3 for Excel kills Add-ins Valuenow Excel Discussion (Misc queries) 0 October 22nd 07 05:50 AM
Japan characters in Excel 2007 vcunning Excel Discussion (Misc queries) 0 February 24th 07 10:36 PM
Excel-2003 Plug-In Program kumar_8675 Excel Programming 1 October 26th 04 05:05 AM
automation error kills excel Simon Prince Excel Programming 2 December 18th 03 09:02 AM


All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"