ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Msgbox question (https://www.excelbanter.com/excel-programming/280335-msgbox-question.html)

Pancho

Msgbox question
 
Is it possible I can obtain the Msgbox-button text?
If you issue a msgbox command like:
Msgbox "Question", vbDefaultButton1 + vbYesNoCancel

in a English Excel it will be displayed like the following:


Title: Microsoft Excel
Text: Question
Buttons: <Yes <No <Cancel

but in Spanish Excel it will be displayed like this:

Title: Microsoft Excel
Text: Question
Buttons: <Si <No <Cancelar

I need the text Yes,No,Cancel or Si,No,Cancelar, previous
to the issuing of the message box, because my "Text" has
that text on it.

Thanks
Francisco Mariscal

fcomariscal at hotmail dot com

Jose Rojas

Msgbox question
 
Pacho no entiendo explicate mejor
"Pancho" wrote in message
...
Is it possible I can obtain the Msgbox-button text?
If you issue a msgbox command like:
Msgbox "Question", vbDefaultButton1 + vbYesNoCancel

in a English Excel it will be displayed like the following:


Title: Microsoft Excel
Text: Question
Buttons: <Yes <No <Cancel

but in Spanish Excel it will be displayed like this:

Title: Microsoft Excel
Text: Question
Buttons: <Si <No <Cancelar

I need the text Yes,No,Cancel or Si,No,Cancelar, previous
to the issuing of the message box, because my "Text" has
that text on it.

Thanks
Francisco Mariscal

fcomariscal at hotmail dot com




Harald Staff

Msgbox question
 
Hi Francisco

I think that is close to impossible from what I've seen on newsgroups like
"microsoft.public.win32.programmer.internation al".

But if english, spanish and maybe a few other languages are what you need;
you can obtain Excel's language version with
Application.International(xlCountryCode) and do a select case ti decide
which message to use. Determining Windows' (=Application.OperatingSystem)
language version is far trickier, but see
http://www.microsoft.com/globaldev/d...efault.mspx#Q4

--
HTH. Best wishes Harald
Followup to newsgroup only please

"Pancho" skrev i melding
...
Is it possible I can obtain the Msgbox-button text?
If you issue a msgbox command like:
Msgbox "Question", vbDefaultButton1 + vbYesNoCancel

in a English Excel it will be displayed like the following:


Title: Microsoft Excel
Text: Question
Buttons: <Yes <No <Cancel

but in Spanish Excel it will be displayed like this:

Title: Microsoft Excel
Text: Question
Buttons: <Si <No <Cancelar

I need the text Yes,No,Cancel or Si,No,Cancelar, previous
to the issuing of the message box, because my "Text" has
that text on it.

Thanks
Francisco Mariscal

fcomariscal at hotmail dot com




jaf

Msgbox question
 
Hi Pancho,
If you only have a few strings to deal with you can do something like this.

'in a public module
Dim MyLangID As String, MyStrings(2) As String

Sub test()
Set objLangSet = Application.LanguageSettings

If objLangSet.LanguageID(msoLanguageIDInstall) = 1033 Then
MyLangID = "English"
MyStrings(0) = "Question"
MyStrings(1) = "Error"
Else
MyLangID = "Espaņol "
MyStrings(0) = "Pregunta"
MyStrings(1) = "Error"
End If
Debug.Print MyLangID, MyStrings(0), MyStrings(1)
End Sub

Sub anywhere()
Msgbox MyString(0), vbDefaultButton1 + vbYesNoCancel

End Sub

--

John

johnf202 at hotmail dot com


"Pancho" wrote in message
...
Is it possible I can obtain the Msgbox-button text?
If you issue a msgbox command like:
Msgbox "Question", vbDefaultButton1 + vbYesNoCancel

in a English Excel it will be displayed like the following:


Title: Microsoft Excel
Text: Question
Buttons: <Yes <No <Cancel

but in Spanish Excel it will be displayed like this:

Title: Microsoft Excel
Text: Question
Buttons: <Si <No <Cancelar

I need the text Yes,No,Cancel or Si,No,Cancelar, previous
to the issuing of the message box, because my "Text" has
that text on it.

Thanks
Francisco Mariscal

fcomariscal at hotmail dot com




Pancho

Msgbox question
 
Jose, Gracias por contestar, lo que tengo es un letrero
que le pide al usuario :
Archivo Ya existe desea crear uno Nuevo?
<Yes para crear uno nuevo borrando el anterior
<No para abrir el archivo anterior y usarlo
<Cancel para Cancelar y no hacer nada

pero esos letreros de Yes, No, Cancel debo poder
cambiarlos dependiendo del idioma del Excel (Es una rutina
con usuarios, Brasileņos, Norteamericanos, espaņoles e
Italianos)
Y el mensaje esta usando actualmente una instruccion
MsgBox, por eso necesito saber que palabras usa Excel en
cada uno de los idiomas para ponerle a los botones de
YesNOCancel,
Y queria ver si es posible saberlo directamente de los
botones?

Gracias
Francisco Mariscal
fcomariscal at hotmail dot com

-----Original Message-----
Pacho no entiendo explicate mejor
"Pancho" wrote in

message
...
Is it possible I can obtain the Msgbox-button text?
If you issue a msgbox command like:
Msgbox "Question", vbDefaultButton1 + vbYesNoCancel

in a English Excel it will be displayed like the

following:


Title: Microsoft Excel
Text: Question
Buttons: <Yes <No <Cancel

but in Spanish Excel it will be displayed like this:

Title: Microsoft Excel
Text: Question
Buttons: <Si <No <Cancelar

I need the text Yes,No,Cancel or Si,No,Cancelar,

previous
to the issuing of the message box, because my "Text" has
that text on it.

Thanks
Francisco Mariscal

fcomariscal at hotmail dot com



.



All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com