A family of Microsoft word processing software products for creating web, email, and print documents.
VBA itself works internally as Unicode, but support for Traditional Chinese in identifiers and string handling depends on the system locale and the Office/VBA implementation.
From the specification:
- VBA modules are defined as if encoded in Unicode; the mapping to the actual system encoding is implementation-defined.
- Traditional Chinese identifiers in VBA are based on Windows Codepage 950 (Big5). Characters are mapped between CP950 and Unicode via the
bestfit950.txtmapping.
When the VBA editor shows "????" for a string that contains Traditional Chinese characters, it indicates that the current environment (system locale / VBA editor / font) cannot represent those characters correctly in the code page it is using. As a result, the string literal or variable content is not preserved correctly, so searches using that text will fail.
To make the macro work with Traditional Chinese text:
- Ensure the system and Office installation support the Traditional Chinese locale and fonts.
- Use Unicode-based text handling (which VBA does internally) and avoid relying on a non-Unicode code page that cannot represent the characters.
- If using APIs or conversions such as
VbStrConv.TraditionalChinese, run the code only on a system that supports the Traditional Chinese locale; otherwise, the operation will fail with an error like “This system does not contain support for the Traditional Chinese locale.”
If the current machine does not support the Traditional Chinese locale, the reliable fix is to upgrade or move the macro to a machine that does, so that the CP950↔Unicode mapping and display of Traditional Chinese characters work correctly and the VBA editor no longer collapses them to "????".
References: