switch languages with macro (solved)

ktab

Well-known Member
Joined
Apr 21, 2005
Messages
1,297
Hello,

I was wondering if there is some other way to switch language from english (my default) to greek (my second language) except application.sendkeys("+%") .... alt+shift

thank you
Kostas
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I guess that this is what i'm looking for but it does not seem to work. To test it i made a userform with 2 buttons one with code 1032 (greek) and the other with the code 1033 (US English). Whenever i press these the language indicator by the task bar disappers, and language does not change. I will experiment with that myself, but if you have any ideas, are all welcome.
 
Upvote 0
I found this one, from here:http://www.mabat3.co.il/phpBB/viewtopic.php?topic=2759&forum=10&1


Private Const KLF_REORDER = &H8
Private Const lang_Hebrew = 67961869
Private Const lang_English = 67699721

Private Declare Function ActivateKeyboardLayout Lib "user32" (ByVal HKL As Long, ByVal flags As Long) As Long

Sub English()
Call ActivateKeyboardLayout(lang_English, KLF_REORDER)
End Sub

Sub Hebrew()
Call ActivateKeyboardLayout(lang_Hebrew, KLF_REORDER)
End Sub

This changes languages to english and hebrew.
Does anyone know how these numbers like lang_Hebrew = 67961869 and english = 67699721 are calculated? Or even better where can i find the number for the lang_greek. No it's not &h8 or 408 i've tried these....
 
Upvote 0
Special thanks to Ido Ben Horin for this code:

Private Declare Function GetKeyboardLayout Lib "user32" (ByVal dwLayout As Long) As Long
Sub KeyboardLayout()
MsgBox GetKeyboardLayout(0)
End Sub

Run this macro while you have ****ched to desired language and it will reveal the keyboardlayout number
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,699
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top