Is it possible to change the language of Yes/No buttons in standard vba dialog box ? See the code below:
If MsgBox("Bla bla bla question", vbYesNo) = vbYes Then ...
Is it possible to change the language of Yes/No buttons in standard vba dialog box ? See the code below:
If MsgBox("Bla bla bla question", vbYesNo) = vbYes Then ...
This works
Try using
Userform
, as explained in this linkinstead of changing the language of the yes/no msgbox, you could instead create a user form which can accomplish the same task.
A suggestion of how you could do this:
Create a User Form in your MS Office file, and create two command boxes.
Change the boxes to be Yes/No in your desired language.
Insert a label, and you don't need to bother editing the text in it.
Now, you should add code to your user form. Here, I use the default names for each object/Userform.
This code makes bool and Question publicly accessible to read/write to.
When the form is activated, it replaces the text in Label1 with whatever you set the variable Question to.
Clicking either yes or no will now return True or False based on your answer.
Next, let's create a basic function to call it.
This function prompts the new UserForm to appear, and will return True/False after you answer.
Lastly, this code just tests that we successfully made a working function, and will place your answer(True/False) in the ActiveSheet's Cell(1,1)
Hope this helps, and I recommend reading up on userforms through the link mentioned in another answer: UserForms