How to fix Invalid character in Excel VBAproject ?

Anonymous
2018-02-04T09:31:47+00:00

I have installed an Microsoft Office in a new Laptop. When I opened an Excel file which was copied from my Desktop, invalid character appeared as shown below. The Language Arrangement between Desktop and Excel are nearly the same. Is there any setting of fonts for the environment of VBA? And, anyone would know to overcome such problem?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2018-02-07T05:06:14+00:00

    I want to know how to config the VBA so that it can display the correct character as appearing in the DeskTop!

    AFAIK there is no way to configure VBA. These settings are anywhere deep inside the installed DLL's.

    It is possible to change the Font of the VBA editor (Tools\Options\Editorformat and choose a font that support your local language), but that doesn't solve the issue with the sheet names within the project explorer.

    Andreas.

    Dear Andreas,

    After changing the Font of the VBA editor, the invalid characters inside the scripts are corrected. Thank you!

    I have tried to reinstall the Office after changing the environment of Windows 10 so that all, the Window and Office, were showing Chinese characters. But the name of Sheets and the Macros inside the VBAproject are still showing invalid characters.

    I believe there is something wrong to my settings. Any further advice?

    Tony

    Dear Andreas,

    After setting of System Locale of Windows inside the Control Panel, the invalid characters problem of VBAproject has been fixed.

    Underneath is the appearance of VBAproject after fixed. Thank you for your support.

    Tony

    0 comments No comments
Answer accepted by question author
  1. Andreas Killer 144K Reputation points Volunteer Moderator
    2018-02-04T15:56:21+00:00

    Your Laptop must have the same language and region settings as your Desktop PC.

    And you must install the same language version of Office on your Laptop.

    Andreas.

    0 comments No comments

7 additional answers

Sort by: Most helpful
  1. Anonymous
    2018-02-05T00:14:21+00:00

    Your Laptop must have the same language and region settings as your Desktop PC.

    And you must install the same language version of Office on your Laptop.

    Andreas.

    Dear Andreas,

    The Laptop has the same language and region settings with the Desktop already. In Excel, no problem was found. Only in the VBAproject has such problem that some macros do not work!

    Tony

    0 comments No comments
  2. Andreas Killer 144K Reputation points Volunteer Moderator
    2018-02-05T08:07:55+00:00

    I've already seen this issue in the past, the problem is that the sheets have Unicode chars in there names.

    Such file works only on the local PC.

    There are 2 ways out of this:

    a) Don't use Unicode chars within the VBA project settings and the code

    b) Install the same language version of Office on your laptop.

    Andreas.

    0 comments No comments
  3. Anonymous
    2018-02-05T09:57:24+00:00

    I've already seen this issue in the past, the problem is that the sheets have Unicode chars in there names.

    Such file works only on the local PC.

    There are 2 ways out of this:

    a) Don't use Unicode chars within the VBA project settings and the code

    b) Install the same language version of Office on your laptop.

    Andreas.

    The Windows and the Office are installed the same language already. In Excel, in such enviroment, all the characters are ok. I want to know how to config the VBA so that it can display the correct character as appearing in the DeskTop!

    Tony

    0 comments No comments