0

I have an excel file with a password-protected VBA macro written with Japanese characters that I'm having quite the trouble of working with.

Whenever I tried opening it on Excel 2016 for Mac OS X, the file gives me several error pop ups and when I go to view the macro, the password protection is gone and when can view the VBA code, it is filled with mojibake text for all the Japanese characters.

I've run this same file with a Windows PC before and it works smoothly, so I'm thinking this is a Mac Office-specific issue.

Is there anyway to fix this on Mac Excel?

3
  • What's the language of Module in Workbook? Did Mac use the same language as Windows?
    – Lee
    Dec 19, 2018 at 9:07
  • As far as I know, the workbook was written with a Japanese Windows PC, and my Mac was setup in US English. Dec 20, 2018 at 0:16
  • Go to VB editor and change the Module name to English, the Module name in English language Mac maybe mess up.
    – Lee
    Dec 20, 2018 at 1:34

1 Answer 1

0

For a deployment with a Japanese distro of MS Office, better use only ASCII characters in your code: procedure names, variable names, string content, etc. That is, no ANSI above Chr$(127), no accented characters, no "special" characters.

In other words, those two lines would fail:

Function carréRaçine(élève As String)  
If élève = "caleçon" Then  

Those two will pass:

Function carreRacine(eleve As String)  
If eleve = "calecon" Then  

If you need accented characters inside a string, use for example Chr$(233) instead of é

Truth of the matter is, most accented letters are not a problem in a Japanese distro of Office, however I could never have a complete list of the problematic ones, which tend to change based on OS (Japanese Office on Mac or Windows) and VBA versions: VBA6 (up to Office 2013) or VBA7 (from Office 2007 onward).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .