0
votes

I have a problem with my Excel (Office 365, Windows 10) VBA Project. I am attempting to create a GETTEXT equivalent, allowing authors to internationalize and therefore provide localisations for their own projects. I am trying to replicate the view that somebody using Excel would see if using an RTL language such as Arabic.

I have downloaded, and installed the Arabic language pack. I have made it my preferred language and it opens up as default with my Office apps (BTW - I Don't understand Arabic, I could have as easily downloaded any other RTL language).

I have selected an Arabic font from Tools > Options > Editor Format > Font: Normal Text = "Dubai Medium (Arabic)"

Unfortunately, I am not able to display Arabic text directly in Control Properties window, e.g. Form caption or Textbox text; nor am I able to type or paste Arabic text into the Editor window. I get the dreaded ????.

Built-in Excel Message boxes and commands appear in Arabic and as RTL, but my message boxes and forms can't be set. The only workaround I've found so far is to place the Arabic text in a worksheet cell and call it from there or to paste the text directly into the form control. Also MsgBox allows RTL and Right-Align Text constants, which is fine, but this leaves my Forms all messed up, even if I programmatically change the .Left and .TextAlign values of controls, I still have the issue of left-aligned Form caption, right-aligned close button, and various issues with MultiPage and TabStrip alignment.

I can't believe Microsoft would be so awkward, so I must be missing something. I'm loathe to install Arabic as my Windows language just to test things, as that would really mess up my day - I'd be totally lost - no offence to Arabic users!

Any help would be much appreciated.

1
BTW, I can't set the Form's RightToLeft property to True either. It insists on sticking to False. When I set this programmatically in the Form's initialize routine, it immediately reverts to False by the next line. - diafol
Ok, bit the bullet and installed the Windows Algerian Arabic language pack. Change to that display language and still nothing - no ability to set RightToLeft = True on Form properties. Took me ages to switch back to my native language - scary! Am truly bamboozled. - diafol

1 Answers

0
votes

Ok, I finally got it to work (sort of). I had to set the System Locale to Arabic. This can be done by the following:

Settings > Time and Language > Language > Administrative Language Settings (link)

Then on the ensuing dialog...

Under the Language for non-Unicode programs, press the Change System Locale button and choose one of the Arabic options.

The only issue is that the Form caption is not right-aligned and the control box (close) is still on the right. But I guess that's small potatoes. All controls with a scrollbar / button (RefEdit, ListBox, ComboBox etc) now have the correct RTL positions. Tabstrips, Frames and MultiPages are also correctly RTL'd. I hope this helps anybody else puzzling over this issue.

Screenshot of RTL'd form