ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determining Language Version of Excel (https://www.excelbanter.com/excel-programming/318466-determining-language-version-excel.html)

Paul

Determining Language Version of Excel
 
A quick quesion:

Is there an easy way of determining the language version of Excel?

I am trying to fix up an app in Excel that includes the following line of
code:

Application.CommandBars("Tools").Controls("Protect ion").Enabled = False

This is used to prevent users from switching off protection (please no
comments on the method used - it is not my app, I've just been asked to fix
it).

The problem is that a few users have the German version of Excel and the
commands ("Tools" and "Protection") have different names.

I'd like to determine the language version of Excel and run the line above
(it its English) or a line using the German terms (if it is German).

I'm not confident about using the index values of the items in case the
menus have been modified at all. If there is some other method of specifying
the controls (that is not language/version specific) I'd be interested in
hearing about it.

Thanks

Paul

--
Visit my website www.pdtech.co.uk for Access Developer Resources



Frank Kabel

Determining Language Version of Excel
 
Hi
always use the ID of this control to assign it to an object. Don't use
the names

--
Regards
Frank Kabel
Frankfurt, Germany

"Paul" schrieb im Newsbeitrag
...
A quick quesion:

Is there an easy way of determining the language version of Excel?

I am trying to fix up an app in Excel that includes the following

line of
code:

Application.CommandBars("Tools").Controls("Protect ion").Enabled =

False

This is used to prevent users from switching off protection (please

no
comments on the method used - it is not my app, I've just been asked

to fix
it).

The problem is that a few users have the German version of Excel and

the
commands ("Tools" and "Protection") have different names.

I'd like to determine the language version of Excel and run the line

above
(it its English) or a line using the German terms (if it is German).

I'm not confident about using the index values of the items in case

the
menus have been modified at all. If there is some other method of

specifying
the controls (that is not language/version specific) I'd be

interested in
hearing about it.

Thanks

Paul

--
Visit my website www.pdtech.co.uk for Access Developer Resources




Ron de Bruin

Determining Language Version of Excel
 
Hi Paul

Look on this page
http://www.rondebruin.com/menuid.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Frank Kabel" wrote in message ...
Hi
always use the ID of this control to assign it to an object. Don't use
the names

--
Regards
Frank Kabel
Frankfurt, Germany

"Paul" schrieb im Newsbeitrag
...
A quick quesion:

Is there an easy way of determining the language version of Excel?

I am trying to fix up an app in Excel that includes the following

line of
code:

Application.CommandBars("Tools").Controls("Protect ion").Enabled =

False

This is used to prevent users from switching off protection (please

no
comments on the method used - it is not my app, I've just been asked

to fix
it).

The problem is that a few users have the German version of Excel and

the
commands ("Tools" and "Protection") have different names.

I'd like to determine the language version of Excel and run the line

above
(it its English) or a line using the German terms (if it is German).

I'm not confident about using the index values of the items in case

the
menus have been modified at all. If there is some other method of

specifying
the controls (that is not language/version specific) I'd be

interested in
hearing about it.

Thanks

Paul

--
Visit my website www.pdtech.co.uk for Access Developer Resources






Paul

Determining Language Version of Excel
 
Unfortunately they are using Excel 97 and from the help file description of
the ID property this was only introduced in 2000.

I think I'm going to have to check the language version in use:

application.LanguageSettings.LanguageID(msoLanguag eIDUI)

Then run the line that disables the Protection option using the appriopriate
menu names for the country.

Thanks

Paul

--
Visit my website www.pdtech.co.uk for Access Developer Resources
"Frank Kabel" wrote in message
...
Hi
always use the ID of this control to assign it to an object. Don't use
the names

--
Regards
Frank Kabel
Frankfurt, Germany

"Paul" schrieb im Newsbeitrag
...
A quick quesion:

Is there an easy way of determining the language version of Excel?

I am trying to fix up an app in Excel that includes the following

line of
code:

Application.CommandBars("Tools").Controls("Protect ion").Enabled =

False

This is used to prevent users from switching off protection (please

no
comments on the method used - it is not my app, I've just been asked

to fix
it).

The problem is that a few users have the German version of Excel and

the
commands ("Tools" and "Protection") have different names.

I'd like to determine the language version of Excel and run the line

above
(it its English) or a line using the German terms (if it is German).

I'm not confident about using the index values of the items in case

the
menus have been modified at all. If there is some other method of

specifying
the controls (that is not language/version specific) I'd be

interested in
hearing about it.

Thanks

Paul

--
Visit my website www.pdtech.co.uk for Access Developer Resources






Ron de Bruin

Determining Language Version of Excel
 
Hi Paul

See the KB links for 97 at the bottom of this page
http://www.rondebruin.com/menuid.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Paul" wrote in message ...
Unfortunately they are using Excel 97 and from the help file description of the ID property this was only introduced in 2000.

I think I'm going to have to check the language version in use:

application.LanguageSettings.LanguageID(msoLanguag eIDUI)

Then run the line that disables the Protection option using the appriopriate menu names for the country.

Thanks

Paul

--
Visit my website www.pdtech.co.uk for Access Developer Resources
"Frank Kabel" wrote in message ...
Hi
always use the ID of this control to assign it to an object. Don't use
the names

--
Regards
Frank Kabel
Frankfurt, Germany

"Paul" schrieb im Newsbeitrag
...
A quick quesion:

Is there an easy way of determining the language version of Excel?

I am trying to fix up an app in Excel that includes the following

line of
code:

Application.CommandBars("Tools").Controls("Protect ion").Enabled =

False

This is used to prevent users from switching off protection (please

no
comments on the method used - it is not my app, I've just been asked

to fix
it).

The problem is that a few users have the German version of Excel and

the
commands ("Tools" and "Protection") have different names.

I'd like to determine the language version of Excel and run the line

above
(it its English) or a line using the German terms (if it is German).

I'm not confident about using the index values of the items in case

the
menus have been modified at all. If there is some other method of

specifying
the controls (that is not language/version specific) I'd be

interested in
hearing about it.

Thanks

Paul

--
Visit my website www.pdtech.co.uk for Access Developer Resources









All times are GMT +1. The time now is 07:18 AM.

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