Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help please - I want to program an interface to Excel 2003 | Excel Discussion (Misc queries) | |||
SP3 for Excel kills Add-ins | Excel Discussion (Misc queries) | |||
Japan characters in Excel 2007 | Excel Discussion (Misc queries) | |||
Excel-2003 Plug-In Program | Excel Programming | |||
automation error kills excel | Excel Programming |